forked from github/cinny
feat: allow using filenames in codeblocks (#2455)
Allow using filenames in codeblocks - If there is a dot in the language name, we instead treat the first line after ``` as the filename and everything after the last dot as the language - we use a custom "data-label" attribute on the code block to specify the name of the file (so only compatible with cinny from this point onwards)
This commit is contained in:
@@ -71,7 +71,7 @@ const permittedTagToAttributes = {
|
||||
ul: ['data-md'],
|
||||
a: ['name', 'target', 'href', 'rel', 'data-md'],
|
||||
img: ['width', 'height', 'alt', 'title', 'src', 'data-mx-emoticon'],
|
||||
code: ['class', 'data-md'],
|
||||
code: ['class', 'data-md', 'data-label'],
|
||||
strong: ['data-md'],
|
||||
i: ['data-md'],
|
||||
em: ['data-md'],
|
||||
|
||||
Reference in New Issue
Block a user