From 0b82d248d3fc34cb41d958b4e547ea12b8cd81f7 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Mon, 5 Dec 2022 13:05:48 +0100 Subject: [PATCH] Fixes #143 --- common/deps.ts | 1 + common/parser.ts | 9 +++------ web/cm_plugins/hide_mark.ts | 2 -- web/style.ts | 1 + web/styles/theme.scss | 8 ++++++++ website/CHANGELOG.md | 1 + 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/common/deps.ts b/common/deps.ts index fc6f61b4..e98c681b 100644 --- a/common/deps.ts +++ b/common/deps.ts @@ -35,6 +35,7 @@ export { MarkdownParser, parseCode, parser as baseParser, + Strikethrough, Subscript, Superscript, Table, diff --git a/common/parser.ts b/common/parser.ts index 828caa84..6de72a3e 100644 --- a/common/parser.ts +++ b/common/parser.ts @@ -7,6 +7,7 @@ import { markdown, MarkdownConfig, StreamLanguage, + Strikethrough, styleTags, Table, tags as t, @@ -127,7 +128,7 @@ const CommandLink: MarkdownConfig = { const HighlightDelim = { resolve: "Highlight", mark: "HighlightMark" }; -export const Strikethrough: MarkdownConfig = { +export const Highlight: MarkdownConfig = { defineNodes: [ { name: "Highlight", @@ -250,6 +251,7 @@ export default function buildMarkdown(mdExtensions: MDExt[]): Language { FrontMatter, TaskList, Comment, + Highlight, Strikethrough, Table, ...mdExtensions.map(mdExtensionSyntaxConfig), @@ -257,11 +259,6 @@ export default function buildMarkdown(mdExtensions: MDExt[]): Language { { props: [ styleTags({ - // WikiLink: ct.WikiLinkTag, - // WikiLinkPage: ct.WikiLinkPageTag, - // WikiLinkAlias: ct.WikiLinkPageTag, - // CommandLink: ct.CommandLinkTag, - // CommandLinkName: ct.CommandLinkNameTag, Task: ct.TaskTag, TaskMarker: ct.TaskMarkerTag, Comment: ct.CommentTag, diff --git a/web/cm_plugins/hide_mark.ts b/web/cm_plugins/hide_mark.ts index 27c005ac..342619bc 100644 --- a/web/cm_plugins/hide_mark.ts +++ b/web/cm_plugins/hide_mark.ts @@ -25,7 +25,6 @@ const typesWithMarks = [ "InlineCode", "Highlight", "Strikethrough", - // "CommandLink", ]; /** * The elements which are used as marks. @@ -35,7 +34,6 @@ const markTypes = [ "CodeMark", "HighlightMark", "StrikethroughMark", - // "CommandLinkMark", ]; /** diff --git a/web/style.ts b/web/style.ts index 22bde370..11ec66c8 100644 --- a/web/style.ts +++ b/web/style.ts @@ -40,6 +40,7 @@ export default function highlightStyles(mdExtension: MDExt[]) { { tag: [t.regexp, t.escape, t.special(t.string)], class: "sb-string2" }, { tag: t.variableName, class: "sb-variableName" }, { tag: t.typeName, class: "sb-typeName" }, + { tag: t.strikethrough, class: "sb-strikethrough" }, { tag: t.comment, class: "sb-comment" }, { tag: t.invalid, class: "sb-invalid" }, { tag: t.processingInstruction, class: "sb-meta" }, diff --git a/web/styles/theme.scss b/web/styles/theme.scss index 163f5526..74044a44 100644 --- a/web/styles/theme.scss +++ b/web/styles/theme.scss @@ -187,6 +187,14 @@ font-size: 0.9em; } +.sb-strikethrough { + text-decoration: line-through; + + &.sb-meta { + text-decoration: none; + } +} + .sb-line-hr { border-top: rgb(76, 75, 75) solid 1px; margin-top: 1em; diff --git a/website/CHANGELOG.md b/website/CHANGELOG.md index 176e1c50..621a102b 100644 --- a/website/CHANGELOG.md +++ b/website/CHANGELOG.md @@ -6,6 +6,7 @@ release. ## Next * Replaced the `--password` flag with `--user` taking a basic auth combination of username and password, e.g. `--user pete:1234`. Authentication now uses standard basic auth. This should fix attachments not working with password protected setups. +* Added support for ~~strikethrough~~ syntax. ---