markdown for pages #338
1 changed files with 6 additions and 6 deletions
|
@ -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],
|
||||||
|
|
Loading…
Reference in a new issue