Skip to content

docs: improve escape pipe in Markdown tables#5539

Merged
lex111 merged 4 commits into
facebook:mainfrom
forresst:patch-1
Sep 8, 2021
Merged

docs: improve escape pipe in Markdown tables#5539
lex111 merged 4 commits into
facebook:mainfrom
forresst:patch-1

Conversation

@forresst

@forresst forresst commented Sep 8, 2021

Copy link
Copy Markdown
Contributor

From a remark on Crowdin:

The value for the Type entry in the plugin-content-blog page is strange.
In English documents, the Type item value is normally displayed.
ex) editUrl: string | EditUrlFunction
However, in French documentation, the Type item value is shown as an unknown code.
ex) editUrl:!!crwdBlockTags_249_sgaTkcolBdwrc!!
ex) blogSidebarCount: !!crwdBlockTags_250_sgaTkcolBdwrc!!

I think that the string <code> 'light' &#124; 'dark' </code> is blocked by Crowdin because of the pipe escape

This is a test to see if the other way to escape a pipe in a markdown table could solve the problem.

Motivation

First, see if the preview of this page works well in Docusaurus.

In a second time, if the first point works, see if it unblocks the problem in Crowdin

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

Related PRs

None

From a remark on Crowdin:
> The value for the Type entry in the plugin-content-blog page is strange.
> In English documents, the Type item value is normally displayed.
> ex) editUrl: string | EditUrlFunction
> However, in French documentation, the Type item value is shown as an unknown code.
> ex) editUrl:!!crwdBlockTags_249_sgaTkcolBdwrc!!
> ex) blogSidebarCount: !!crwdBlockTags_250_sgaTkcolBdwrc!!

This is a test to see if the other way to escape a pipe in a markdown table could solve the problem.
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Sep 8, 2021
@netlify

netlify Bot commented Sep 8, 2021

Copy link
Copy Markdown

✔️ [V2]
Built without sensitive environment variables

🔨 Explore the source changes: 15d7ad0

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/613896c4f0e4790007cf4268

😎 Browse the preview: https://deploy-preview-5539--docusaurus-2.netlify.app

@github-actions

github-actions Bot commented Sep 8, 2021

Copy link
Copy Markdown

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 95
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-5539--docusaurus-2.netlify.app/

@forresst

forresst commented Sep 8, 2021

Copy link
Copy Markdown
Contributor Author

The other way to escape a pipe in a markdown table works:

image

Is it possible to merge this PR to see if it can solve the problem in Crowdin ?

@Josh-Cena

Copy link
Copy Markdown
Collaborator

Can we also fix this in other places? In plugin-content-blog and plugin-content-docs

@forresst

forresst commented Sep 8, 2021

Copy link
Copy Markdown
Contributor Author

Can we also fix this in other places? In plugin-content-blog and plugin-content-docs

@Josh-Cena That's what I was thinking of doing in a second step, but I'd like to check that it fixes the problem in Crowdin first

For now, here is the problem in crowdin:
image

@Josh-Cena

Copy link
Copy Markdown
Collaborator

Yes, but even if it doesn't, it improves readability (I didn't like the HTML entities either but didn't even think <code> \| as a possibility), and things are currently broken anyways, so it will be a gain with no loss

@forresst

forresst commented Sep 8, 2021

Copy link
Copy Markdown
Contributor Author

@Josh-Cena Ok I will modify all the docs

@forresst forresst changed the title Test escape pipe in Markdown table WIP: Test escape pipe in Markdown table Sep 8, 2021
Comment thread website/versioned_docs/version-2.0.0-beta.6/api/themes/theme-configuration.md Outdated
Comment thread website/versioned_docs/version-2.0.0-beta.6/api/themes/theme-configuration.md Outdated
Comment thread website/versioned_docs/version-2.0.0-beta.6/api/themes/theme-configuration.md Outdated
Comment thread website/versioned_docs/version-2.0.0-beta.6/api/themes/theme-configuration.md Outdated
Comment thread website/versioned_docs/version-2.0.0-beta.6/api/themes/theme-configuration.md Outdated
Comment thread website/versioned_docs/version-2.0.0-beta.6/api/themes/theme-configuration.md Outdated
Comment thread website/versioned_docs/version-2.0.0-beta.6/api/themes/theme-configuration.md Outdated
@lex111

lex111 commented Sep 8, 2021

Copy link
Copy Markdown
Contributor

@forresst looks good to me, can I merge it?

@forresst forresst changed the title WIP: Test escape pipe in Markdown table Improve escape pipe in Markdown table Sep 8, 2021
@forresst

forresst commented Sep 8, 2021

Copy link
Copy Markdown
Contributor Author

@lex111 Perfect! Thanks! You can merge it!

@lex111 lex111 added documentation The issue is related to the documentation of Docusaurus pr: documentation This PR works on the website or other text documents in the repo. and removed documentation The issue is related to the documentation of Docusaurus labels Sep 8, 2021
@lex111 lex111 changed the title Improve escape pipe in Markdown table docs: improve escape pipe in Markdown tables Sep 8, 2021
@lex111 lex111 merged commit 02eee61 into facebook:main Sep 8, 2021
@lex111

lex111 commented Sep 8, 2021

Copy link
Copy Markdown
Contributor

@forresst thanks!

@forresst forresst deleted the patch-1 branch September 8, 2021 12:12
@forresst

forresst commented Sep 8, 2021

Copy link
Copy Markdown
Contributor Author

Unfortunately, this still does not solve the problem in Crowdin 😢

@Josh-Cena

Copy link
Copy Markdown
Collaborator

My second guess is the <code> tag inside markdown table, is there a way to test Crowdin without updating the website? 🤔

@forresst

forresst commented Sep 8, 2021

Copy link
Copy Markdown
Contributor Author

@Josh-Cena I think you are right. the tag can perhaps be problematic in a markdown table.

I don't know if it is possible to test it directly in Crowdin. An opinion @slorber ?

@lex111

lex111 commented Sep 8, 2021

Copy link
Copy Markdown
Contributor

I'm not sure if Crowdin has a playground or something like that (FYI slorber on vacation).
Maybe we should change Type column to Possible Values, where we list comma-separated acceptable values?

Name Possible Values Default Description
defaultMode 'light', 'dark' 'light' The color mode when user first visits the site.

@Josh-Cena

Copy link
Copy Markdown
Collaborator

@lex111 The original intent was to have the notation resemble TS—we have Item[], number | 'ALL', string | EditUrlFunction, etc., not sure if "possible values" would break the consistency

@lex111

lex111 commented Sep 9, 2021

Copy link
Copy Markdown
Contributor

I misspelled, of course we are talking about types, not values. And it is unlikely that such change would worsen the understanding about Possible Types of fields. In our situation it would be a good compromise, so let's give it a try. We could even use just white space as a separator instead of comma.

@slorber

slorber commented Sep 22, 2021

Copy link
Copy Markdown
Collaborator

Hey, created a dedicated issue and will ping Crowdin support about it: #5602

mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
* Test escape pipe in Markdown table 

From a remark on Crowdin:
> The value for the Type entry in the plugin-content-blog page is strange.
> In English documents, the Type item value is normally displayed.
> ex) editUrl: string | EditUrlFunction
> However, in French documentation, the Type item value is shown as an unknown code.
> ex) editUrl:!!crwdBlockTags_249_sgaTkcolBdwrc!!
> ex) blogSidebarCount: !!crwdBlockTags_250_sgaTkcolBdwrc!!

This is a test to see if the other way to escape a pipe in a markdown table could solve the problem.

* Fix all docs to replace &facebook#124; by \|

* Keep `code`

* Apply suggestions from code review

Co-authored-by: Alexey Pyltsyn <lex61rus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: documentation This PR works on the website or other text documents in the repo.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants