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

Provide a way to customize MARKDOWN2JSON #79

Closed
UlyssesZh opened this issue Nov 22, 2023 · 3 comments
Closed

Provide a way to customize MARKDOWN2JSON #79

UlyssesZh opened this issue Nov 22, 2023 · 3 comments

Comments

@UlyssesZh
Copy link
Contributor

For example, to make the tab characters being preserved when using Paru::PandocFilter::Node#markdown=, I have to

Paru::PandocFilter::MARKDOWN2JSON.__send__ :preserve_tabs

This is kind of a hack. What is the correct way to do this?

@htdebeer
Copy link
Owner

I never thought about preserving tabs while manipulating AST via the convenience method markdown=. I suppose switching that property on by default shouldn't have a negative impact on paru's functioning. But I'll have to look into that to make sure.

Can you given an example where preserving tabs is important?

@UlyssesZh
Copy link
Contributor Author

In my blog, I use tabs in code blocks and use tab-size in CSS to conveniently change tab size without needing to touch the source files of the articles.

I also wrote a Pandoc filter to transform a code block into some HTML. Whether I use HTML tags directly in Markdown or use raw blocks, the tabs will be converted to 4 spaces. I have to turn on --preserve-tabs.

@htdebeer
Copy link
Owner

Starting in version 1.2, paru preserves tabs by default. Please test this version to see if it works for your use case.

(Note. I also upgraded the minumum Ruby version to 3.0.6)

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

No branches or pull requests

2 participants