Markdown files

Markdown is a popular plain-text file format for creating formatted text. For example, many software developers use it for easily creating documentation. It has many different variants (also called flavors). memoQ supports the most widely-used flavor, CommonMark, and shows a preview of how the file looks when converted into HTML.

The CommonMark syntax has very complicated rules about how to write some elements - so that conversion to HTML works as clearly as possible. This topic doesn't go into all the details. To learn more, read the latest version of the CommonMark specification.

How to get here

  1. Start importing a Markdown file.

  2. In the Document import options window, select the MD file, and click Change filter and configuration.

  3. The Document import settings window appears. From the Filter drop-down list, choose Markdown filter.

    srt-filter-OPTIONS

What can you do?

Choose how to handle formatting

Markdown uses special characters like asterisks (*) and underscores (_) for formatting text. The basic rule is: a pair of single asterisks or underscores means italic (same as the <em> HTML tag), and a pair of double asterisks or underscores means bold (same as the <strong> HTML tag).

  • To see such formatting as inline tags (): Choose the memoQ inline tags radio button.

  • To see such formatting in the translation grid (): Choose the memoQ formatted content (where possible) radio button.

    memoQ shows the most common types of text formatting in the translation grid. Markdown has more. memoQ shows those as gray inline tags.

Choose how to handle line breaks

Soft line breaks (when the line ends with a newline character):

  • To see a <br> inline tag where soft line breaks are: Choose the Import as inline tags radio button.

  • To ignore soft line breaks: Choose the Do not import radio button.

  • To ignore soft line breaks but produce more even-looking text in the translated file: Choose the Do not import, but generate average-length lines at export radio button.

Hard line breaks (when the line ends with two spaces or a <br> HTML tag):

  • To start a new segment on every hard line break: Choose the Start new segment radio button.

  • To see a <br> inline tag where hard line breaks are: Choose the Import as inline tags radio button.

  • To have both: Choose the Import as inline tags and start a new segment radio button.

  • To ignore hard line breaks: Choose the Do not import radio button.

Choose how to handle code blocks

There are two kinds of code blocks in Markdown:

  • indented code blocks are one or more neighboring lines that begin with four or more spaces.

  • fenced code blocks are one or more neighboring lines between lines of three or more backticks (`) or tildes (~).

memoQ always imports indented code blocks. Settings in the Code blocks define what happens to fenced code blocks.

  • To import fenced code blocks into the main translation document: Choose the Import as translatable radio button and leave the Import fenced code blocks as embedded objects check box cleared.

  • To import fenced code blocks into separate documents under the main translation document: Choose the Import as translatable radio button and check the Import fenced code blocks as embedded objects check box.

  • To ignore fenced code blocks: Choose the Do not import radio button.

Even if you don't import fenced code blocks for translation, they will be visible in the preview.

Choose how to handle HTML content

Markdown files can have HTML content inside. When the HTML content is in blocks of neighboring lines, you can import them as separate embedded files under the Markdown file. To do this, at the bottom of the Document import options window, check the Import embedded objects check box.

memoQ imports these embedded files using its HTML filter, which is, at the time of writing (Q2 2024) not configurable, and does not import HTML comments.

When a comment is not inside a HTML block (that is, it is between lines of non-HTML content), you can import it into the Markdown file itself. To do this, in the Markdown filter configuration's HTML section, check the Import top-level HTML comments as translatable check box.

In the current version, memoQ can't import HTML comments inside HTML blocks.

When you finish

To confirm the settings, and return to the Document import options window: Click OK.

To return the Document import options window, and not change the filter settings: Click Cancel.

In the Document import options window: Click OK again to start importing the documents.