Skip to content

tools,doc: fix misrendering of consecutive JS blocks - #40146

Closed
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:fix-tools
Closed

tools,doc: fix misrendering of consecutive JS blocks#40146
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:fix-tools

Conversation

@Trott

Copy link
Copy Markdown
Member

Our markdown-to-html tool was assuming that any consecutive JS blocks
were ESM vs CJS alternatives, but that is not always the case, resulting
in both a confusing interface and invalid HTML.

Our markdown-to-html tool was assuming that any consecutive JS blocks
were ESM vs CJS alternatives, but that is not always the case, resulting
in both a confusing interface and invalid HTML.
@nodejs-github-botnodejs-github-bot added doc Issues and PRs related to the documentations. tools Issues and PRs related to the tools directory. labels Sep 18, 2021
@Trott

Copy link
Copy Markdown
MemberAuthor

There are three examples of this in the docs. Here is how a part of packages.html should be rendering (and how it renders with this change):

image

Here's how it looks currently:

image

The current situation results in a <pre> within another <pre> which is invalid HTML.

@TrottTrott added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 18, 2021
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 18, 2021
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@aduh95

Copy link
Copy Markdown
Contributor

Weird, I thought I had taken this into consideration with line 227:

nextNode.lang!==node.lang){

Maybe line 227 can be removed if it's actually not useful.

@Trott

Copy link
Copy Markdown
MemberAuthor

Maybe line 227 can be removed if it's actually not useful.

I tried removing it but doing so ends up in garbled code examples elsewhere in the docs, so it seems like both statements handle different edge cases.

@targostargos added the fast-track PRs that do not need to wait for 48 hours to land. label Sep 19, 2021
@github-actions

Copy link
Copy Markdown
Contributor

Fast-track has been requested by @targos. Please 👍 to approve.

@aduh95aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 19, 2021
@github-actionsgithub-actionsBot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 19, 2021
@github-actions

Copy link
Copy Markdown
Contributor

Landed in 0bafe6d...b0d5eec

nodejs-github-bot pushed a commit that referenced this pull request Sep 19, 2021
Our markdown-to-html tool was assuming that any consecutive JS blocks
were ESM vs CJS alternatives, but that is not always the case, resulting
in both a confusing interface and invalid HTML.
PR-URL: #40146
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
BethGriggs pushed a commit that referenced this pull request Sep 21, 2021
Our markdown-to-html tool was assuming that any consecutive JS blocks
were ESM vs CJS alternatives, but that is not always the case, resulting
in both a confusing interface and invalid HTML.
PR-URL: #40146
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
BethGriggs pushed a commit that referenced this pull request Sep 21, 2021
Our markdown-to-html tool was assuming that any consecutive JS blocks
were ESM vs CJS alternatives, but that is not always the case, resulting
in both a confusing interface and invalid HTML.
PR-URL: #40146
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
@BethGriggsBethGriggs mentioned this pull request Sep 21, 2021
1 task
@Trott
Trott deleted the fix-tools branch September 25, 2022 17:13
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docIssues and PRs related to the documentations.fast-trackPRs that do not need to wait for 48 hours to land.toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@Trott@nodejs-github-bot@aduh95@targos@tniessen