Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix figure caption not showing in produced docx or HTML document #123

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ZhongYic00
Copy link

Using the latest version, I cannot see caption in docx output, and the figure is made inline with wrong style(Body, should be Captioned Figure).
That's because Image is inline node, while Figure is a block node consists of (FigureCaption,Array<block>).
Pandoc auto-generated AST use such structure, only so can the caption be displayed in docx output (also applies to HTML output in my test).
Below is a piece of auto-gen AST:

Figure
    ( "superfig" , [] , [] )
    (Caption
       Nothing
       [ Plain
           [ Str "caption"
           , Space
           , Str "text\22270\24335\20449\24687"
           ]
       ])
    [ Plain
        [ Image
            ( "" , [] , [] )
            [ Str "caption"
            , Space
            , Str "text\22270\24335\20449\24687"
            ]
            ( "/home/zyc/Pictures/whu-logo.png" , "" )
        ]
    ]

The produced HTML of test.md:
image
image


This PR bases upon the bump version PR #122

Image is inline node, while Figure is a block node consists of (FigureCaption,sub blocks). Pandoc auto-generated AST use such structure, only so can the caption be displayed in docx output.
@BrentHuang
Copy link

实测通过,谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants