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

Problems with pages not displaying bold plus italics #86

Open
T34-active opened this issue Jan 16, 2025 · 4 comments
Open

Problems with pages not displaying bold plus italics #86

T34-active opened this issue Jan 16, 2025 · 4 comments
Labels
needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@T34-active
Copy link

What information was incorrect, unhelpful, or incomplete?

Use *** to write bold italicized text that will be automatically converted to **_.

What did you expect to see?

Hopefully it will render bold italics correctly

Do you have any supporting links, references, or citations?

mdn/translated-content#25458

Do you have anything more you want to share?

No response

@T34-active T34-active added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jan 16, 2025
@yin1999
Copy link
Member

yin1999 commented Jan 16, 2025

Let me explain the problem we encountered in the mentioned PR:

There are two italic + bold styles for markdown: ***xxx***, or **_xxx_**. And the format tool we used - prettier - prefer the later one. But in the zh-CN content, we have some texts like this: **_具名插槽_**是具有 `name` 属性的 `<slot>` 元素。, which should be correctly rendered. But rari just treats the "italic + bold style" in such a text as normal text with italic style (see the screenshot of https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/slot below). I've also use yari to build the document, and I can found that the italic + bold style could be correctly rendered.

Rari:

Image

Yari:

image

@caugner
Copy link
Contributor

caugner commented Jan 22, 2025

@T34-active @yin1999 Can you explain why you need to combine bold with italic? As far as I can see, mdn/content has no such occurrence. In the example, wouldn't it suffice to use bold alone?

@yin1999
Copy link
Member

yin1999 commented Jan 22, 2025

@T34-active @yin1999 Can you explain why you need to combine bold with italic? As far as I can see, mdn/content has no such occurrence. In the example, wouldn't it suffice to use bold alone?

Hey @caugner. I can found the cases in mdn/content: https://github.com/search?q=repo%3Amdn%2Fcontent%20%22**_%22&type=code.

The problem is that there is no space between Chinese characters, which may affect the parse function of rari (parsing the italic + bold style used in zh-CN/zh-TW).

@fiji-flo
Copy link
Contributor

That's seems to be something remark supported. But most markdown flavors I tested don't (most notably the preview here and commonmark.

Also most guides strongly recommend *** instead of **_ (see https://www.markdownguide.org/basic-syntax/#bold-and-italic-best-practices).

I lost faith in prettier's markdown after prettier/prettier#16596

Is there a feasible way to make prettier ignore this and use ***?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

No branches or pull requests

4 participants