File Import Settings

.MD / .MDX - Markdown and MDX (TMS)

File Types

  • .MD

  • .MARKDOWN

  • .MDX

Import Options

  • Filter 

    Choose which Markdown dialect the parser uses when importing the file. This also affects which characters are automatically escaped/unescaped on import and export.

    • Plain

      Parses base Markdown structure only (headings, paragraphs, lists, basic emphasis).

    • PHP/Python Markdown Extra

      Parses using the PHP Markdown Extra / Python-Markdown "Extra" dialect, adding support for tables, definition lists, footnotes, abbreviations, and attribute lists.

    • GitHub Flavored Markdown

      Parses using the GitHub Flavored Markdown (GFM) spec, adding support for tables, task lists, strikethrough, and autolinks.

    • MDX

      Parses the file as MDX: Markdown plus JSX components, JSX expressions ({...}), and ESM import/export statements. Tables, task lists, strikethrough, and autolinks work as in GitHub Flavored Markdown. Indented code blocks and angle-bracket autolinks (<url>) are not supported, since MDX uses indentation to nest components and does not parse those constructs.

      MDX is Markdown extended with JSX, so the content can embed components and JavaScript expressions (for example, in documentation built with Docusaurus or Next.js). The MDX filter is never selected automatically: it must be selected in the file import settings, both for .MDX files and for .MD files that contain MDX syntax. There is no detection by file extension or content.

      Note

      MDX support must be enabled for your organization. If MDX is not available in the Filter list, contact your Customer Success Manager or Phrase Support.

      Important

      Switching an existing project from another Markdown filter to MDX changes how the content is segmented. Expect a one-time drop in translation memory leverage after the switch.

  • Hard line break creates new segment 

    Starts a new segment at each hard line break.

  • Preserve whitespaces 

    Preserves the same whitespace structure in the target document (e.g. spacing, newlines, etc.).

  • Process YAML header 

    Processes the YAML front matter at the top of the file. When selected, .YAML import settings are applied.

  • Import code blocks 

    Extracts the content of code blocks for translation. With the MDX filter, this also applies to fenced code blocks nested inside JSX components (for example, inside <CodeGroup>).

  • Exclude code elements 

    When this option is selected, code elements are imported as single Phrase TMS tags.

  • Make URLs translatable

    Makes URLs available for translation.

  • Convert to Phrase TMS tags 

    Apply regular expressions to convert specified text to tags.

    Important

    Issues with tags are a common cause of export errors. Always ensure tags and formatting are correct before exporting files by running quality assurance checks.

  • Custom elements (converted to Phrase tags) 

    Define the elements in the file to be converted into tags.

  • Non-translatable blocks 

    Define sections in the file that should not be imported.

    Example:

    Element name: notrans.

    Code: <notrans>Chrysler</notrans> entered three factory-prepared <notrans>Dodge Shadows</notrans> to the event in 1985. All three vehicles retired in the first day of the three-day <notrans>Olympus</notrans> rally.

    Result: Chrysler は、1985年に工場で準備された3台の Dodge Shadows に参加しました。3台の車両はすべて3日間の Olympus ラリーの初日にリタイアしました。

  • Don't escape characters 

    A list of characters that shouldn't be escaped in the completed file (for instance, #, -, [, <,\,`, ![,](,:).

    With the MDX filter, both < and { are escaped by default in translated text, because an unescaped < or { in the target would otherwise break the MDX syntax. Add them here only if the raw, unescaped character is specifically needed in the output.

MDX-Specific Options

The following four options are available only when MDX is selected in Filter.

  • Translatable attributes

    Define additional JSX tag/attribute pairs to make them translatable, using the same tag/attribute format as the Translatable attributes setting of the HTML filter. For example, Figure/title translates the title attribute only on the Figure component, while title (unscoped) translates it on every tag.

    Custom components (tag names starting with an uppercase letter, such as <Figure>) have no translatable attributes by default, so list them here explicitly. Lowercase/HTML-style tags (<img>, <a>, etc.) already have standard attribute defaults.

  • Import default translatable attributes

    Enabled by default.

    Applies the standard HTML translatable-attribute defaults (for example, alt on <img>, title on <a>) to lowercase/HTML-style tags, in addition to anything listed in Translatable attributes. Custom components never receive these defaults, regardless of this setting. Their attributes are translatable only when added to Translatable attributes.

    When disabled, only the attributes listed in Translatable attributes are translatable, even on lowercase tags.

  • Make elements translatable by default

    Enabled by default.

    Sets whether the text inside a JSX component is translatable by default.

    • When enabled: Text inside any component (for example, <Tabs>, <Note>) is translatable, unless the component is listed in Elements overriding default translatability.

    • When disabled: Text inside components is not translatable, unless the component is listed in Elements overriding default translatability.

  • Elements overriding default translatability

    A comma-separated list of component names that get the opposite of the Make elements translatable by default setting.

    A component listed here is switched as a whole: its entire content, including any components nested inside it, follows the override and is not evaluated individually. When the override makes a component non-translatable, its content is preserved exactly as written. Use this list to:

    • exclude a few non-prose components (for example, CodeGroup, Mermaid) when Make elements translatable by default is enabled, or

    • allow-list a few prose-bearing components when that setting is disabled.

How JSX Content Is Handled

This applies when MDX is selected in Filter.

  • JSX tags (<Component>, <Component attr="value" />) and tag and attribute names are never translatable. Only element content and the attribute values explicitly configured are translatable.

  • Expressions in curly braces ({...}), JavaScript expressions, spread attributes ({...props}), and comments ({/* comment */}) are never translatable. They are preserved exactly as written, wherever they appear: in attributes, inline in text, or on their own line.

  • import and export statements are always excluded from translation, wherever they appear in the file.

Was this article helpful?
★ ★ ★ ★ ★

Sorry about that! In what way was it not helpful?

The article didn’t address my problem.
I couldn’t understand the article.
The feature doesn’t do what I need.
Other reason.

Note that feedback is provided anonymously so we aren't able to reply to questions.
If you'd like to ask a question, submit a request to our Support team.
Thank you for your feedback.