From d0549136ff0f3732b442c538133216324fd14bc8 Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle Date: Mon, 12 Nov 2018 17:07:52 +0100 Subject: [PATCH] added patch to disable cellspacing and added css style for table borders --- markdown-it/info.json | 4 +-- markdown-it/markdown-it.qml | 2 +- ...n-it-to-use-no-cellspacing-for-table.patch | 25 +++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 markdown-it/patches/0001-modified-markdown-it-to-use-no-cellspacing-for-table.patch diff --git a/markdown-it/info.json b/markdown-it/info.json index 8202cea..3a1ec45 100644 --- a/markdown-it/info.json +++ b/markdown-it/info.json @@ -3,8 +3,8 @@ "identifier": "markdown-it", "script": "markdown-it.qml", "resources": ["markdown-it.js"], - "authors": ["@milan-rusev"], - "version": "1.0.1", + "authors": ["@milan-rusev", "@pbek"], + "version": "1.1.0", "minAppVersion": "17.08.2", "description" : "This script replaces the default markdown renderer with markdown-it.\n\nDependencies\nmarkdown-it.js (v8.3.2 bundled with the script)\n\nUsage\nFor the possible configuration options check here." } diff --git a/markdown-it/markdown-it.qml b/markdown-it/markdown-it.qml index 06dfd0b..4047b5a 100644 --- a/markdown-it/markdown-it.qml +++ b/markdown-it/markdown-it.qml @@ -83,7 +83,7 @@ QtObject { //Get original styles var head = html.match(new RegExp("(?:.|\n)*?"))[0]; //Add custom styles - head = head.replace("", customStylesheet + ""); + head = head.replace("", "table {border-spacing: 0; border-style: solid; border-width: 1px; border-collapse: collapse;}" + customStylesheet + ""); mdHtml = ""+head+""+mdHtml+""; diff --git a/markdown-it/patches/0001-modified-markdown-it-to-use-no-cellspacing-for-table.patch b/markdown-it/patches/0001-modified-markdown-it-to-use-no-cellspacing-for-table.patch new file mode 100644 index 0000000..defce26 --- /dev/null +++ b/markdown-it/patches/0001-modified-markdown-it-to-use-no-cellspacing-for-table.patch @@ -0,0 +1,25 @@ +From bf476454ec3e7b6432f88c20f43c1f33ba76acf0 Mon Sep 17 00:00:00 2001 +From: Patrizio Bekerle +Date: Mon, 12 Nov 2018 17:02:17 +0100 +Subject: [PATCH] modified markdown-it to use no cellspacing for tables + +--- + markdown-it/markdown-it.js | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/markdown-it/markdown-it.js b/markdown-it/markdown-it.js +index cedb788..54c4940 100644 +--- a/markdown-it/markdown-it.js ++++ b/markdown-it/markdown-it.js +@@ -4053,7 +4053,7 @@ module.exports = function table(state, startLine, endLine, silent) { + + if (silent) { return true; } + +- token = state.push('table_open', 'table', 1); ++ token = state.push('table_open', 'table cellspacing="0"', 1); + token.map = tableLines = [ startLine, 0 ]; + + token = state.push('thead_open', 'thead', 1); +-- +2.19.1 +