fix(docx): keep heavy leader for ptab stops (#318)
Co-authored-by: Aniruddha Adak <aniruddhaadak80@users.noreply.github.com>
This commit is contained in:
co-authored by
Aniruddha Adak
parent
b3374c19f2
commit
ae6c94df44
@@ -322,6 +322,7 @@ export function ptabDisplayStops(pNode: XNode): import('./types').TabStop[] {
|
||||
leader === 'dot' ||
|
||||
leader === 'hyphen' ||
|
||||
leader === 'underscore' ||
|
||||
leader === 'heavy' ||
|
||||
leader === 'middleDot'
|
||||
) {
|
||||
stop.leader = leader
|
||||
|
||||
@@ -111,4 +111,18 @@ describe('w:ptab absolute position tabs', () => {
|
||||
})
|
||||
expect(xml).not.toContain('<w:tabs>')
|
||||
})
|
||||
|
||||
it('ptab heavy leader survives like w:tab', async () => {
|
||||
const doc = await parseDocx(
|
||||
await buildDocx({
|
||||
bodyXml:
|
||||
'<w:p><w:r><w:t>A</w:t></w:r>' +
|
||||
'<w:r><w:ptab w:relativeTo="margin" w:alignment="right" w:leader="heavy"/></w:r>' +
|
||||
'<w:r><w:t xml:space="preserve"> </w:t></w:r></w:p>',
|
||||
}),
|
||||
)
|
||||
expect(doc.blocks[0].format?.tabStops).toEqual([
|
||||
{ pos: 100, val: 'right', leader: 'heavy', rel: 'margin' },
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user