-
Notifications
You must be signed in to change notification settings - Fork 837
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
Very simple preformatted code block does not get converted properly #435
Comments
This looks like it's working on the live demo: https://mixmark-io.github.io/turndown/ ``` fruits = ["apple", "banana", "cherry"] for fruit in fruits: print(fruit) ``` |
Looks like this happens only when I pass the HTML element directly, whereas if I instead do
the element is converted as I expected. Is this intended behavior? FWIW, I see that when I pass the element directly, the thing that makes it to |
The var turndownService = new TurndownService({ codeBlockStyle: 'fenced' })
turndownService.turndown('<pre><code class="language-js">console.log("hello world")</code></pre>') |
I have a very simple element:
that I would like converted to a fenced code block via
TurndownService::turndown
I initialize the TurndownService with
However, turndown yields the following string when I pass my element:
I've verified by hand that the
fencedCodeBlock.filter
returns true when passed my element and thatfencedCodeBlock.replacement
returns the expected string sandwiched by the fence, but this behavior is not reproduced as expected when usingTurndownService::turndown
The text was updated successfully, but these errors were encountered: