mammoth.js icon indicating copy to clipboard operation
mammoth.js copied to clipboard

w:sdt to custom element

Open carliblaz opened this issue 1 year ago • 2 comments

Hi, I can see that w:sdt element is included in parsing document.xml. Is there a chance to styleMap this element to some different HTML tags?

carliblaz avatar Aug 25 '23 05:08 carliblaz

Could you provide a minimal example document, the HTML you'd expect to see, the HTML you're actually seeing, and the style map you'd like to use?

mwilliamson avatar Aug 25 '23 11:08 mwilliamson

Hi,

It's docx with developer option text field: <w:sdt> <w:sdtPr> <w:rPr> <w:noProof/> <w:lang w:eastAsia="sl-SI"/> </w:rPr> <w:id w:val="964228880"/> <w:placeholder> <w:docPart w:val="DefaultPlaceholder_-1854013440"/> </w:placeholder> <w:showingPlcHdr/> <w:text/> </w:sdtPr> <w:sdtContent> <w:p w:rsidRDefault="00221C0B" w:rsidR="00221C0B" w14:textId="3F8B4E21" w14:paraId="6E3135AB"> <w:pPr> <w:rPr> <w:noProof/> <w:lang w:eastAsia="sl-SI"/> </w:rPr> </w:pPr> <w:r w:rsidRPr="00730AFC"> <w:rPr> <w:rStyle w:val="Besedilooznabemesta"/> </w:rPr> <w:t>Click or tap here to enter text.</w:t> </w:r> </w:p> </w:sdtContent> </w:sdt>

So if there is an option to render this as <input name="964228880" type="text">

carliblaz avatar Aug 29 '23 06:08 carliblaz