amine-aboufirass / pandoc-latex-writer

Custom writer for rapid note taking in markdown
MIT License
0 stars 0 forks source link

Add glossaries #1

Closed amine-aboufirass closed 2 years ago

amine-aboufirass commented 2 years ago

Done

amine-aboufirass commented 2 years ago

The way that glossary elements are being detected is not sufficiently robust. Currently there are two nested if statements:

elif isinstance(elem, pf.Div):
    if "glossary" in elem.classes

Considering the fact that Div elements will also contain Table elements, the outermost condition is too general. Something like this might be better:

elif isinstance(elem, pf.Div) and isinstance(elem.content[0], pf.DefinitionList):
    if "glossary" in elem.classes:
        #...
    elif "abbrv" in elem.classes:
        #...