1
0
Fork 0
mirror of https://github.com/marty-oehme/scripts.git synced 2024-12-22 07:58:08 +00:00

added patch to disable cellspacing and added css style for table borders

This commit is contained in:
Patrizio Bekerle 2018-11-12 17:07:52 +01:00
parent bf476454ec
commit d0549136ff
No known key found for this signature in database
GPG key ID: 2E9FFD770DABE838
3 changed files with 28 additions and 3 deletions

View file

@ -3,8 +3,8 @@
"identifier": "markdown-it", "identifier": "markdown-it",
"script": "markdown-it.qml", "script": "markdown-it.qml",
"resources": ["markdown-it.js"], "resources": ["markdown-it.js"],
"authors": ["@milan-rusev"], "authors": ["@milan-rusev", "@pbek"],
"version": "1.0.1", "version": "1.1.0",
"minAppVersion": "17.08.2", "minAppVersion": "17.08.2",
"description" : "This script replaces the default markdown renderer with markdown-it.\n\n<b>Dependencies</b>\n<a href=\"https://github.com/markdown-it/markdown-it\">markdown-it.js</a> (v8.3.2 bundled with the script)\n\n<b>Usage</b>\nFor the possible configuration options check <a href=\"https://github.com/markdown-it/markdown-it/tree/master/lib/presets\">here</a>." "description" : "This script replaces the default markdown renderer with markdown-it.\n\n<b>Dependencies</b>\n<a href=\"https://github.com/markdown-it/markdown-it\">markdown-it.js</a> (v8.3.2 bundled with the script)\n\n<b>Usage</b>\nFor the possible configuration options check <a href=\"https://github.com/markdown-it/markdown-it/tree/master/lib/presets\">here</a>."
} }

View file

@ -83,7 +83,7 @@ QtObject {
//Get original styles //Get original styles
var head = html.match(new RegExp("<head>(?:.|\n)*?</head>"))[0]; var head = html.match(new RegExp("<head>(?:.|\n)*?</head>"))[0];
//Add custom styles //Add custom styles
head = head.replace("</style>", customStylesheet + "</style>"); head = head.replace("</style>", "table {border-spacing: 0; border-style: solid; border-width: 1px; border-collapse: collapse;}" + customStylesheet + "</style>");
mdHtml = "<html>"+head+"<body>"+mdHtml+"</body></html>"; mdHtml = "<html>"+head+"<body>"+mdHtml+"</body></html>";

View file

@ -0,0 +1,25 @@
From bf476454ec3e7b6432f88c20f43c1f33ba76acf0 Mon Sep 17 00:00:00 2001
From: Patrizio Bekerle <patrizio@bekerle.com>
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