mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 13:42:51 +00:00
Sanitize plugin docs content (#2900)
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"fuse.js": "^7.0.0",
|
||||
"isomorphic-dompurify": "^1.11.0",
|
||||
"yaml": "^2.3.1"
|
||||
}
|
||||
}
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import DOMPurify from 'isomorphic-dompurify';
|
||||
import { marked } from 'marked';
|
||||
import { parse as YAMLParse } from 'yaml';
|
||||
|
||||
@@ -23,5 +24,5 @@ export function getContent(data: string): string {
|
||||
if (!content) {
|
||||
throw new Error("Can't get the content");
|
||||
}
|
||||
return marked(content) as string;
|
||||
return DOMPurify.sanitize(marked(content) as string);
|
||||
}
|
||||
|
Reference in New Issue
Block a user