Improve supported functions documentation (#1511)

* Remove empty lower right cells

* Escape backticks(`) using <code></code>

* Escape vertical bars(|) using <code> and HTML entity code

* Normalize documentation links

* Remove empty thead
This commit is contained in:
ylemkimon
2018-07-28 10:23:49 +09:00
committed by Ron Kok
parent 8a38035855
commit 4114288403
3 changed files with 45 additions and 17 deletions

30
website/empty_thead.js Normal file
View File

@@ -0,0 +1,30 @@
module.exports = function(md, options) {
function removeEmptyThead(state) {
const tokens = state.tokens;
let thead = -1;
let empty = true;
for (let i = tokens.length - 1; i >= 0; i--) {
const tok = tokens[i];
switch (tok.type) {
case 'thead_close':
thead = i;
break;
case 'thead_open':
if (empty) {
tokens.splice(i, thead - i + 1);
}
thead = -1;
empty = true;
break;
case 'inline':
if (thead !== -1 && tok.content.length > 0) {
empty = false;
}
break;
}
}
}
md.core.ruler.after('block', 'empty_thead', removeEmptyThead);
};