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

Blacklist feature and highlighted code #10

Open
tmpfs opened this issue Feb 20, 2017 · 2 comments
Open

Blacklist feature and highlighted code #10

tmpfs opened this issue Feb 20, 2017 · 2 comments

Comments

@tmpfs
Copy link

tmpfs commented Feb 20, 2017

Just a heads up that the blacklist feature doesn't always work.

Let's say I have a markdown document that I process and convert all code blocks to highlighted HTML markup using source-highlight then I have lots of <span> elements within the <pre><code> blocks, retext will operate on them which is not what I want.

I imagine the proper way to fix this would be to open counters/flags for the elements to determine whether we are inside a pre block and reset them when we exit the pre block. For the moment I have disabled this plugin because I want my code to be copied/pasted but would be willing to contribute to find a good solution for this.

@jescalan
Copy link
Member

Hmm so does your markdown plugin read the markdown and then convert it into a reshape AST, or as a string? Converting to a reshape ast might solve the issue...

@tmpfs
Copy link
Author

tmpfs commented Feb 20, 2017

I preprocess the markdown documents and replace fenced code blocks that have language info strings with HTML elements (including the nested span elements) and then include these markdown documents, using include(src="document.md"). I have enabled HTML for markdown-it which makes everything work great except I have to disable retext or I get the curly quotes in my code blocks.

The problem as I understand it is the nested span elements otherwise the blacklist feature would work. I need the nested span elements to style the code.

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

No branches or pull requests

2 participants