Skip to content

Support CJK Friendly Emphasis #11932

@tats-u

Description

@tats-u

Have you read the Contributing Guidelines on issues?

Motivation

Image

We have to insert extra spaces for workaround:

Image

Docusaurus 3 has a regression that asterisks */** around punctuation including ` representing inline codes and [/] representing links are not recognized as emphasis. This affects especially on Chinese and Japanese documents.

https://docusaurus.io/docs/next/migration/v3#other-markdown-incompatibilities suggests using remark-cjk-friendly (#10892) but it should be opt-in or opt-out in the future.

There are two proposed methods for setting it up:

import type { Config } from "@docusaurus/types";
import type { Options } from "@docusaurus/preset-classic";
const config: Config = {
  // *snip*
  markdown: {
    cjkFriendlyEmphasis: true, // Plan (1)
  },
  presets: [
    [
      "classic": 
      {
        cjkFriendlyEmphasis: true, // Plan (2),
        // *snip*
      } as Options
    ],
  ],
  // *snip*
};

export default config;

Also there are 3 proposed strategies for enabling it:

  • opt-out & dependencies
  • opt-in & dependencies
  • opt-in & optional peerDependencies (users need to run pnpm add remark-cjk-friendly remark-cjk-friendly-strikethrough)

Self-service

  • I'd be willing to do some initial work on this proposal myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalThis issue is a proposal, usually non-trivial changestatus: needs triageThis issue has not been triaged by maintainers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions