Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STRIKETHROUGH doesn't work without FENCED_CODE_BLOCKS #131

Closed
weavejester opened this issue May 15, 2014 · 2 comments
Closed

STRIKETHROUGH doesn't work without FENCED_CODE_BLOCKS #131

weavejester opened this issue May 15, 2014 · 2 comments

Comments

@weavejester
Copy link

Curiously, the STRIKETHROUGH extension doesn't appear to work on its own in 1.4.2. It only works if the FENCED_CODE_BLOCKS extension is also active.

new PegDownProcessor(Extensions/STRIKETHROUGH)
  .markdownToHtml("~~foo~~");
// produces "<p>~~foo~~</p>"

new PegDownProcessor(Extensions/FENCED_CODE_BLOCKS)
  .markdownToHtml("~~foo~~");
// produces "<p>~~foo~~</p>"

new PegDownProcessor(Extensions/FENCED_CODE_BLOCKS + Extensions/STRIKETHROUGH)
  .markdownToHtml("~~foo~~");
// produces "<p><del>foo</del></p>"
@berndv
Copy link

berndv commented Jul 30, 2014

Think there is just the addition of the "~" char to the list of special chars missing for option STRIKETHROUGH. See org.pegdown.Parser.

    public Rule SpecialChar() {
        String chars = "*_`&[]<>!#\\";
        if (ext(QUOTES)) {
            chars += "'\"";
        }
        if (ext(SMARTS)) {
            chars += ".-";
        }
        if (ext(AUTOLINKS)) {
            chars += "(){}";
        }
        if (ext(DEFINITIONS)) {
            chars += ":";
        }
        if (ext(TABLES)) {
            chars += "|";
        }
        if (ext(DEFINITIONS) | ext(FENCED_CODE_BLOCKS)) {
            chars += "~";
        }
        for (Character ch : plugins.getSpecialChars()) {
            if (!chars.contains(ch.toString())) {
                chars += ch;
            }
        }
        return AnyOf(chars);
    }

vsch added a commit to vsch/pegdown that referenced this issue Aug 22, 2015
fix Escaped Characters for disabled extensions sirthias#179
add StrikeNode has isClosed() member sirthias#178
fix Reference node includes trailing blank lines sirthias#177
fix Setext headers not allowing blanks after --- or === sirthias#176
fix CaptionNode not having source index range set sirthias#175
add ATXHEADERSPACE extension to require a space/tab after # in AtxHeaders sirthias#144
add RELAXEDHRULES extenstion to relax requirement of a blank line after horiz. rule. sirthias#129
fix STRIKETHROUGH extension did not add ~ to special characters. sirthias#131
vsch added a commit to vsch/pegdown that referenced this issue Aug 22, 2015
fix Definition Lists sirthias#180
fix Escaped Characters for disabled extensions sirthias#179
add StrikeNode has isClosed() member sirthias#178
fix Reference node includes trailing blank lines sirthias#177
fix Setext headers not allowing blanks after --- or === sirthias#176
fix CaptionNode not having source index range set sirthias#175
add ATXHEADERSPACE extension to require a space/tab after # in AtxHeaders sirthias#144
add RELAXEDHRULES extenstion to relax requirement of a blank line after horiz. rule. sirthias#129
fix STRIKETHROUGH extension did not add ~ to special characters. sirthias#131
@sirthias
Copy link
Owner

Closed by #181.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants