timonwong / OmniMarkupPreviewer

Sublime Text 2&3 plugin to live preview markup files, supported (not limited to) markup formats are markdown, reStructuredText, WikiCreole and textile.
MIT License
500 stars 75 forks source link

Strikethrough not work on v 3.0.0 #106

Closed Explorare closed 7 years ago

Explorare commented 7 years ago

ST3 Build 3126 The string Strike through this text. is rendered as picture shown below:

How to fix it?

y1zhou commented 7 years ago

85 @scuml provided a fix here. The quick fix 2 worked like a charm for me.

Explorare commented 7 years ago

@SCP-028 Thanks for your relpy. But I've tried this method. It seems not work for me.

import markdown
from markdown.inlinepatterns import SimpleTagPattern

STRIKEOUT_RE = r'(\~\~)([^\s](?:.*))(\~\~)'

class StrikeoutExtension(markdown.Extension):
    """ Strikeout extension for Python-Markdown. """

    def extendMarkdown(self, md, md_globals):
        """ Modifies inline patterns. """
        md.inlinePatterns.add('del', SimpleTagPattern(STRIKEOUT_RE, 'del'), '<not_strong')

# def makeExtension(configs=None):
#     return StrikeoutExtension(configs=configs)

def makeExtension(*args, **kwargs):
    return StrikeoutExtension(*args, **kwargs)

Reload Sublime but the bug is still there. Did I do something wrong?

y1zhou commented 7 years ago

I've got the same file and it works fine here. Could you post a copy of your config file? Make sure that you didn't remove strikeout from here:

{
    "renderer_options-MarkdownRenderer": {
        "extensions": ["tables", "strikeout", "fenced_code", "codehilite"],
    }
}
Explorare commented 7 years ago

@SCP-028 My user settings for this plugin is empty. And markdown render options in default settings is just like you said

"renderer_options-MarkdownRenderer": {
    "extensions": ["tables", "strikeout", "fenced_code", "codehilite"]
}
y1zhou commented 7 years ago

@Explorare Hmm... I don't know exactly why as we have same configurations but different outputs. Maybe you can try removing the plugin and reinstalling it, but I'm not sure if that'll work. Hope someone else gets here and solves your problem 😞

Explorare commented 7 years ago

@SCP-028 Thanks for your help. ( ゚∀。)

Explorare commented 7 years ago

@SCP-028 I've found where the problem is. I confused sublime build system [Ctrl+B] and this plugin [Ctrl+Alt+O]. What I saw is HTML build system output but not markup render output.

I realized this problem after I reinstalled the plugin. And I met the same 404 bug. And world became wonderful again after replace the bug lines. I'm such a noob ( ´_ゝ`)

Thanks for your help. The problem has been fixed. ゚・:.。..。.:・゜ヽ( ´∀`)人(´∀` )ノ・゜゚・:.。..。.: