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

Markdown code block closing incorrectly #29

Closed
thephez opened this issue Jun 2, 2020 · 1 comment
Closed

Markdown code block closing incorrectly #29

thephez opened this issue Jun 2, 2020 · 1 comment

Comments

@thephez
Copy link

thephez commented Jun 2, 2020

If any spaces immediately following the ``` that should end a code block, it is not closed properly and it will include the subsequent code block section(s) in the document. It acts as if the the rendering engine only looks for a terminating line break immediately after the last grave accent. Perhaps trailing spaces should be trimmed before determining if it is a single code block or multiples.

This example shows how the rendering is affected with/without a trailing space: https://dashcore-anchortest.readme.io/docs/merged-code-block

@rafegoldberg
Copy link
Contributor

rafegoldberg commented Jun 3, 2020

@thephez fantastic catch. I believe the issue is with the underlying regex that we use to capture tabbed versus standard single code blocks.

https://github.com/readmeio/api-explorer/blob/4e08a616781a533bcee2bfe4a05e161426c8385a/packages/markdown/processor/parse/flavored/code-tabs.js#L1

(Also, I should note that I really appreciate the demo link.)

rafegoldberg referenced this issue in readmeio/api-explorer Jun 3, 2020
rafegoldberg referenced this issue in readmeio/api-explorer Jun 26, 2020
* fix(rdmd/codetabs): closes #719, #724, #723

* test(markdown): meta data is not required; "smart" terminating delimiter; elide spaces before meta data

* test(markdown): update snapshots

* chore(deps): sync lockfiles
@rafegoldberg rafegoldberg transferred this issue from readmeio/api-explorer Aug 4, 2020
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