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

Remove extra trailing line breaks from fenced code blocks #228

Closed
wants to merge 1 commit into from
Closed

Remove extra trailing line breaks from fenced code blocks #228

wants to merge 1 commit into from

Conversation

remyrylan
Copy link

@remyrylan remyrylan commented May 11, 2018

Right now fenced code blocks are produced with a trailing inner line break, such as:

const foo = 'bar'

This change just removes trailing inner line breaks so the output will look as expected:

const foo = 'bar'

@domchristie
Copy link
Collaborator

domchristie commented May 11, 2018

Thanks again for your contribution!

I think the content of (pre-formatted) code blocks should be left as-is, because in some cases it may be intentional or significant.

The library does not (intentionally) add trailing whitespace to code blocks (as far as I'm aware), so I am guessing the trailing whitespace is in your HTML? In which case you may need to preprocess those elements to remove the trailing whitespace.

(Sorry, I don't mean to be a naysayer!)

@remyrylan
Copy link
Author

Dang, you're right. Sorry, I'm going in circles here figuring out where the issue is between turndown, Marked, and TypeDoc... Looks like it's either TypeDoc or Marked. I'll submit PRs over there once I figure it out.

@remyrylan
Copy link
Author

Figured out where the outside issue was, if anyone is curious:
markedjs/marked#1266

Also made a separate PR to Marked to have it default to using language-:
markedjs/marked#1265

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.

2 participants