I've encountered a new problem. A fldChar field can span multiple paragraphs, but it doesn't have to start at the beginning of the first one. Because of this, a field across multiple paragraphs will merge those paragraphs. There is no way to represent this exactly in the pandoc model I think. So my current solution is to have different fields with the same field info in the different paragraphs. This can at least make the hyperlink fields work and I think it will work for the other fields we might add in the future as well (I've checked the list). What do you think about this ? On Monday, June 14, 2021 at 9:17:13 AM UTC+2 Milan Bracke wrote: > For those who don't know fldChar fields, this comment from the docx parse > code (parse.hs, starting on line 825) explains it: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > *fldChar fields work by firsthaving a in a > run, then a run with, then a fldCharType="separate"> run, then thecontent runs, and finally a fldCharType="end"> run. Forexample (omissions and my comments in brackets): > [...] [...] > HYPERLINK [hyperlink url] > [...] w:rsidRPr=[...]> [...] Foundations of Analysis, 2nd Edition > [...] *The current > way of parsing fldChar fields doesn't take into account that they can be > nested. So the end of the nested flcChar field will be interpreted as the > end of the surrounding one. This could for example lead to a hyperlink that > ends too soon. See attached example for a docx that demonstrates this. > > I propose to fix this by turning the fldChar state into a stack, so that a > field can be started and ended inside other fields. I will include this in > my pull request for PAGEREF fields that I announced here a while ago, since > they are related. > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2f5489af-f5a9-4ea4-9155-9f85c4808756n%40googlegroups.com.