Skip to content

Typographic Extension

Vladimir Schneider edited this page Mar 19, 2018 · 1 revision

flexmark-java extension for typographic character processing

Overview

Converts:

  • ' to apostrophe ’
  • ... and . . . to ellipsis …
  • -- en dash –
  • --- em dash —
  • single quoted 'some text' to ‘some text’ ‘some text’
  • double quoted "some text" to “some text” “some text”
  • double angle quoted <<some text>> to &laquo;some text&raquo; «some text»

Syntax

No specific syntax is provided by this extension.

Parsing Details

Use class TypographicExtension in artifact flexmark-ext-typographic.

The following options are available:

Defined in TypographicExtension class:

Static Field Default Value Description
ENABLE_QUOTES true process quotes ", ', <<, >>
ENABLE_SMARTS true process smarts: ', ..., . . ., --, ---
ANGLE_QUOTE_CLOSE "&raquo;" what to use for corresponding typographic sequence
ANGLE_QUOTE_OPEN "&laquo;" what to use for corresponding typographic sequence
ANGLE_QUOTE_UNMATCHED null what to use when neither opening nor closing sequence or null if to leave as is.
DOUBLE_QUOTE_CLOSE "&rdquo;" what to use for corresponding typographic sequence
DOUBLE_QUOTE_OPEN "&ldquo;" what to use for corresponding typographic sequence
DOUBLE_QUOTE_UNMATCHED null what to use when neither opening nor closing sequence or null if to leave as is.
ELLIPSIS "&hellip;" what to use for corresponding typographic sequence
ELLIPSIS_SPACED "&hellip;" what to use for corresponding typographic sequence
EM_DASH "&mdash;" what to use for corresponding typographic sequence
EN_DASH "&ndash;" what to use for corresponding typographic sequence
SINGLE_QUOTE_CLOSE "&rsquo;" what to use for corresponding typographic sequence
SINGLE_QUOTE_OPEN "&lsquo;" what to use for corresponding typographic sequence
SINGLE_QUOTE_UNMATCHED "&rsquo;" what to use when neither opening nor closing sequence or null if to leave as is.