Sublime Forum

Add support for strike-through in markdown

#1

Hi,

I’m trying to add support for strike-through formatting in the bundled markdown language definition, but it doesn’t work.

Github flavored markdown supports strike-through with the ~~deleted text~~ syntax.

I have tried copying the definition for bold in the MarkDown.tmLanguage file, and changed the opening sequence from ** to ~~:

		<key>deleted</key>
		<dict>
			<key>begin</key>
			<string>(~~)(?=\S)     # Open

...]
							(?&lt;=\S)\1								# Close
						)
					</string>
			<key>captures</key>
			<dict>
				<key>1</key>
				<dict>
					<key>name</key>
					<string>punctuation.definition.deleted.markdown</string>
				</dict>
			</dict>
			<key>end</key>
			<string>(?&lt;=\S)(\1)</string>
			<key>name</key>
			<string>markup.deleted.markdown</string>

And I have tried adding some formatting for it in the tmTheme file I use:

		<dict>
			<key>name</key>
			<string>Markup: Deleted</string>
			<key>scope</key>
			<string>markup.deleted</string>
			<key>settings</key>
			<dict>
				<key>fontStyle</key>
				<string> italic</string>
				<key>foreground</key>
				<string>#c0c0c0</string>
			</dict>
		</dict>

When pressing CTRL+ALT+SHIFT+P to see the current scope, all I get is text.html.markdown and meta.paragraph.markdown.

What am I doing wrong?

regards,
-Vegar

0 Likes