Skip to content

Commit f36266b

Browse files
authored
Use custom sanitize function (#6)
* Use custom sanitize function * Include only inline-code class
1 parent b107b98 commit f36266b

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

dist/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codex.editor.inline-code",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"keywords": [
55
"codex editor",
66
"inline",

src/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,12 @@ class InlineCode {
176176
*/
177177
static get sanitize() {
178178
return {
179-
span: {
180-
class: InlineCode.CSS
179+
span: (el) => {
180+
if (el.classList.contains(InlineCode.CSS)) {
181+
return {class: InlineCode.CSS}
182+
} else {
183+
return false;
184+
}
181185
}
182186
};
183187
}

0 commit comments

Comments
 (0)