1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Doc: Refactored documentation, split it into smaller articles, and added search (#9132)

This commit is contained in:
Laurent Cozic
2023-10-30 11:32:14 +00:00
committed by GitHub
parent f94cc0fe3c
commit 5f6370d7ba
237 changed files with 11124 additions and 3131 deletions

View File

@@ -2,4 +2,41 @@
const Entities = require('html-entities').AllHtmlEntities;
const selfClosingElements = [
'area',
'base',
'basefont',
'br',
'col',
'command',
'embed',
'frame',
'hr',
'img',
'input',
'isindex',
'keygen',
'link',
'meta',
'param',
'source',
'track',
'wbr',
];
export const htmlentities = new Entities().encode;
export const attributesHtml = (attr: Record<string, any>) => {
const output = [];
for (const n in attr) {
if (!attr.hasOwnProperty(n)) continue;
output.push(`${n}="${htmlentities(attr[n])}"`);
}
return output.join(' ');
};
export const isSelfClosingTag = (tagName: string) => {
return selfClosingElements.includes(tagName.toLowerCase());
};