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

Answers are not formatted correctly #56

Open
lfdebrux opened this issue Nov 22, 2021 · 0 comments
Open

Answers are not formatted correctly #56

lfdebrux opened this issue Nov 22, 2021 · 0 comments

Comments

@lfdebrux
Copy link
Member

lfdebrux commented Nov 22, 2021

Answers (code blocks within details sections) are not currently being formatted correctly; the contents of the details elements are being treated as normal HTML rather than Markdown or <pre>-formatted code.

See for example the answer for Task 4 in Lesson 2:

Screenshot 2021-11-22 at 10 31 34

This is especially a problem for long answers, which may have linebreaks that are not being rendered by the Markdown parser.

I think I've traced the issue to a change in the tech docs gem Markdown engine, Redcarpet. There is an open issue describing a similar problem vmg/redcarpet#715, and we can see the change in commit vmg/redcarpet@5412f7e which was released in Redcarpet v3.4.0. The problem is that the current version of Redcarpet doesn't allow Markdown within HTML blocks [1]; I'm not sure whether this is by design or not (note that this is different to what the CommonMark spec expects [2]).

I think we have four (potentially non-exclusive) options to workaround/fix this issue:

  • Rewrite answers to use HTML instead of Markdown code blocks
  • Downgrade redcarpet to to a version pre 3.4.0
  • Get Redcarpet to support Markdown within HTML blocks
  • Get tech-docs-gem to support a different Markdown engine
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

1 participant