|
65 | 65 | processor.parse('<table><tr><td>boot<p>hello</p><p>world</p>and universe</td>' \ |
66 | 66 | '<td><p>other</p><p><br/></p><p>last</p></td></tr></table>') |
67 | 67 | expect(text.strings).to eq(['boot', 'hello', 'world', 'and universe', 'other', 'last']) |
68 | | - first_sub_col_left = first_col_left + table_padding |
69 | 68 | expect(left_positions) |
70 | 69 | .to eq([first_col_left, first_col_left, first_col_left, first_col_left, 342, 342]) |
71 | 70 | expect(top_positions) |
|
77 | 76 | first_row_top - 4 * line].map(&:round)) |
78 | 77 | end |
79 | 78 |
|
| 79 | + describe 'nested headings' do |
| 80 | + let(:options) do |
| 81 | + { |
| 82 | + heading1: { size: 36, style: :bold }, |
| 83 | + heading2: { size: 24, style: :bold_italic } |
| 84 | + } |
| 85 | + end |
| 86 | + |
| 87 | + it 'creates headings inside tables' do |
| 88 | + processor.parse('<table><tr><td><h1>hello</h1><h2>world</h2></td></tr></table>') |
| 89 | + expect(text.strings).to eq(['hello', 'world']) |
| 90 | + expect(left_positions).to eq([first_col_left, first_col_left]) |
| 91 | + expect(top_positions).to eq([first_row_top - 17, first_row_top - 50].map(&:round)) |
| 92 | + end |
| 93 | + end |
| 94 | + |
80 | 95 | it 'creates divs inside tables' do |
81 | 96 | processor.parse('<table><tr><td>boot<div>hello<div>world</div><div>and universe</div></div>all the rest</td>' \ |
82 | 97 | '<td><div>other</div></td></tr></table>') |
83 | 98 | expect(text.strings).to eq(['boot', 'hello', 'world', 'and universe', 'all the rest', 'other']) |
84 | | - first_sub_col_left = first_col_left + table_padding |
85 | 99 | expect(left_positions) |
86 | 100 | .to eq([first_col_left, first_col_left, first_col_left, first_col_left, first_col_left, 368]) |
87 | 101 | expect(top_positions) |
|
0 commit comments