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

Add latex-merge as RawBlock format #251

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matthew-brett
Copy link

Quarto generates latex-merge as a RawBlock format.

Accept this as a RawBlock format.

Specifically Quarto filters generate this JSON from Markdown ![An image](some_image.jpg):

                    {
                        "c": [
                            "latex-merge",
                            "\\begin{figure}[H]"
                        ],
                        "t": "RawBlock"
                    },

Without this patch, initial parsing of the JSON input for any Panflute
filter will fail with:

TypeError: element str not in group {'native', 'context', 'docbook',
'man', 'twiki', 'dokuwiki', 'rtf', 'tex', 'markdown', 'vimwiki', 'rst',
'creole', 'opml', 'haddock', 'docx', 'epub', 'icml', 'markdown_mmd',
'markdown_strict', 'org', 't2t', 'mediawiki', 'opendocument', 'json',
'muse', 'openxml', 'commonmark', 'gfm', 'html', 'fb2', 'noteref',
'textile', 'markdown_github', 'ipynb', 'markdown_phpextra', 'latex',
'odt', 'tikiwiki', 'jats', 'typst'}

Quarto generates latex-merge as a RawBlock format.

Accept this as a RawBlock format.

Specifically Quarto filters generate this JSON from Markdown `![An
image](some_image.jpg)`:

```
                    {
                        "c": [
                            "latex-merge",
                            "\\begin{figure}[H]"
                        ],
                        "t": "RawBlock"
                    },
```

Without this patch, initial parsing of the JSON input for any Panflute
filter will fail with:

```
TypeError: element str not in group {'native', 'context', 'docbook',
'man', 'twiki', 'dokuwiki', 'rtf', 'tex', 'markdown', 'vimwiki', 'rst',
'creole', 'opml', 'haddock', 'docx', 'epub', 'icml', 'markdown_mmd',
'markdown_strict', 'org', 't2t', 'mediawiki', 'opendocument', 'json',
'muse', 'openxml', 'commonmark', 'gfm', 'html', 'fb2', 'noteref',
'textile', 'markdown_github', 'ipynb', 'markdown_phpextra', 'latex',
'odt', 'tikiwiki', 'jats', 'typst'}
```
@matthew-brett
Copy link
Author

I think this is a specific instance of the problem referred to in #236 - I guess a more general question is - should RawBlocks be passed through by default - rather than passing through only if expicitly listed in RAW_FORMATS.

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.

1 participant