markdown for pages #338

Open
Johann150 wants to merge 20 commits from markdown into main
Showing only changes of commit cab80c49c0 - Show all commits

View file

@ -15,11 +15,11 @@ const sanitizerOptions = {
}, },
allowedStyles: { allowedStyles: {
span: { span: {
'--mfm-speed': [/^\d*\.?\d+m?s$/], '--mfm-speed': [/^\d*\.?\d+m?s$/], // decimal number (e.g. 1 or 1.0 or .1) followed by "ms" or "s"
'--mfm-deg': [/^\d*\.?\d+$/], '--mfm-deg': [/^\d*\.?\d+$/], // decimal number
'--mfm-x': [/^\d*\.?\d+$/], '--mfm-x': [/^\d*\.?\d+$/], // decimal number
'--mfm-y': [/^\d*\.?\d+$/], '--mfm-y': [/^\d*\.?\d+$/], // decimal number
'--mfm-color': [/^#([0-9a-f]{3}){1,2}$/i], '--mfm-color': [/^#([0-9a-f]{3}){1,2}$/i], // CSS hex color code without alpha
}, },
}, },
allowedSchemes: sanitizeHtml.defaults.allowedSchemes.concat([ 'gopher', 'gemini' ]), allowedSchemes: sanitizeHtml.defaults.allowedSchemes.concat([ 'gopher', 'gemini' ]),
@ -94,7 +94,7 @@ marked.use({
tokenizer(src) { tokenizer(src) {
const match = src.match(/^@([-_a-z0-9]+)(?:@(\p{L}+(?:[-.]*\p{L}+)*))?/iu); const match = src.match(/^@([-_a-z0-9]+)(?:@(\p{L}+(?:[-.]*\p{L}+)*))?/iu);
if (!match) return; if (!match) return;
return { return {
type: 'mention', type: 'mention',
raw: match[0], raw: match[0],