Class Options

    • Field Detail

      • hardwraps

        public boolean hardwraps
        If true, <br/>s are replaced with a simple linebreak.

        If false, <br/>s are replaced with a two spaces followed by a linebreak (default).

      • preserveRelativeLinks

        public boolean preserveRelativeLinks
        If true, relative links are preserved. You must still provide a baseURI!

        Otherwise, relative links are resolved against the provided baseURI (the default).

      • inlineLinks

        public boolean inlineLinks
        If true, place the URLs for links inline.

        Otherwise, generate link IDs and place at the end (the default).

      • simpleLinkIds

        public boolean simpleLinkIds
        If true, link IDs are simply incremented as they are found.

        Otherwise, Remark attempts to generate unique link IDs based on the link description.

      • tables

        public Options.Tables tables
        Configures how tables are handled.
      • reverseHtmlSmartQuotes

        public boolean reverseHtmlSmartQuotes
        If true, replace all smart quote HTML entities (e.g: &ldquo; with simplified characters (e.g: ").
      • reverseUnicodeSmartQuotes

        public boolean reverseUnicodeSmartQuotes
        If true, replace all smart quote unicode characters (e.g: “) with simplified characters (e.g: ").
      • reverseHtmlSmartPunctuation

        public boolean reverseHtmlSmartPunctuation
        If true, replace all smart punctuation HTML entities (e.g: &emdash;) with simplified characters (e.g: ---).
      • reverseUnicodeSmartPunctuation

        public boolean reverseUnicodeSmartPunctuation
        If true, replace all smart punctuation unicode characters (e.g: —) with simplified characters (e.g: ---).
      • definitionLists

        public boolean definitionLists
        If true, enable remarking definitions lists. When enabled, definition lists (<dl>, <dt>, and <dd>) are converted into PHP Markdown Extra style definition lists.
      • autoLinks

        public boolean autoLinks
        If true, enable autoLinks. This only affects links whose href attribute is the same as the node's inner text content. In this case, the URL is simply written directly to the output. Example:
        <a href="http://www.example.com">http://www.example.com</a>
        becomes
        http://www.example.com
      • fencedCodeBlocks

        public Options.FencedCodeBlocks fencedCodeBlocks
        Configures how to handle code blocks. By default, code blocks are only configured using the indented format supported by Markdown. This allows fenced code blocks when necessary.
      • fencedCodeBlocksWidth

        public int fencedCodeBlocksWidth
        Number of times to repeat the fencedCodeBlock character. (Defaults to 10.)
      • ignoredHtmlElements

        public Set<IgnoredHtmlElement> ignoredHtmlElements
        Allows the addition of extra HTML tags that can be left in the output. Please note that this does not override default handling (for example, <em> tags).
      • fixPegdownStrongEmphasisInLinks

        public boolean fixPegdownStrongEmphasisInLinks
        This is a very specific fix for a very specific bug. As of version 1.0.2, pegdown has a serious bug that really slows down when processing many links with bold and italics in the label for an anchor. This option causes Remark to replace items like [***my important link***][link-id] with just bold text, like [**my important link**][link-id]. Note: this was fixed in release 1.1.0!
        See Also:
        Pegdown Issue #34
    • Constructor Detail

      • Options

        public Options()
        Configures a default set of options. The default set is configured to be most compatible with the original Markdown syntax.
    • Method Detail

      • markdown

        public static Options markdown()
        Creates and returns a new Options set with the default options compatible with the original Markdown.
        Returns:
        Options for original Markdown compatibility
      • markdownExtra

        public static Options markdownExtra()
        Creates and returns a new Options set with the default options compatible with PHP Markdown Extra features.

        Enables:

        • headerIDs
        • Markdown Extra fencedCodeBlocks
        • Markdown Extra tables
        • definitionLists
        • abbreviations
        Returns:
        Options for PHP Markdown Extra compatibility
      • multiMarkdown

        public static Options multiMarkdown()
        Creates and returns a new Options set with the default options compatible with MultiMarkdown features.

        Enables:

        • MultiMarkdown tables
        • definitionLists
        Returns:
        Options for MultiMarkdown compatibility
      • pegdownBase

        public static Options pegdownBase()
        Creates and returns a new Options set with the default options compatible with the base pegdown configuration.

        Please note: if you are using pegdown version 1.0.2 or older, you'll need to manually enable fixPegdownStrongEmphasisInLinks.

        Enables:

        • hardwraps
        Returns:
        Options for pegdown compatibility
      • pegdownAllExtensions

        public static Options pegdownAllExtensions()
        Creates and returns a new Options set with the default options compatible with pegdown configured with all extensions.

        Please note: if you are using pegdown version 1.0.2 or older, you'll need to manually enable fixPegdownStrongEmphasisInLinks.

        Enables:

        • hardwraps
        • Markdown Extra fencedCodeBlocks
        • MultiMarkdown tables
        • definitionLists
        • abbreviations
        • autoLinks
        • reverses all Smart options
        Returns:
        Options for pegdown compatibility
      • github

        public static Options github()
        Creates and returns a new Options set with the default options compatible with github-flavored Markdown.

        Enables:

        • hardwraps
        • Github fencedCodeBlocks
        • tables converted to code block
        • autoLinks
        Returns:
        Options for github compatibility
      • getFencedCodeBlocks

        public Options.FencedCodeBlocks getFencedCodeBlocks()
        Always returns a non-null setting for FencedCodeBlocks
        Returns:
        The current FencedCodeBlocks or default if not set.
      • getIgnoredHtmlElements

        public Set<IgnoredHtmlElement> getIgnoredHtmlElements()
        Always returns a non-null setting for IgnoredHtmlElements
        Returns:
        The current set of IgnoredHtmlElements or an empty set if null.
      • getTables

        public Options.Tables getTables()
        Always returns a non-null setting for Tables
        Returns:
        the current Tables or default if not set.
      • getInWordEmphasis

        public Options.InWordEmphasis getInWordEmphasis()
        Always returns a non-null setting for InWordEmphasis
        Returns:
        the current InWordEmphasis or default if not set.
      • setReverseSmartQuotes

        public void setReverseSmartQuotes​(boolean reverse)
        Utility method to set reversing of both unicode and html smart quotes.
        Parameters:
        reverse - true if they should be reversed
      • setReverseSmartPunctuation

        public void setReverseSmartPunctuation​(boolean reverse)
        Utility method to set reversing of both unicode and html smart punctuation.
        Parameters:
        reverse - true if they should be reversed
      • setReverseAllSmarts

        public void setReverseAllSmarts​(boolean reverse)
        Utility method to set reversing of both unicode and html smart quotes and punctuation.
        Parameters:
        reverse - true if they should be reversed
      • getCopy

        public Options getCopy()