r/flask • u/0_emordnilap_a_ton • 3d ago
Ask r/Flask I originally typed my question into ai. But I want to confirm if it is correct. In quills and nh3 how do I sanitize all the tags? The problem is sometimes the AI says stuff like iframe has to be secured better. Is this correct? Also can someone show a simple working example of nh3 ?
https://nh3.readthedocs.io/en/latest/ https://quilljs.com/
"use strict";
const toolbarOptions = [
["bold", "italic", "underline", "strike"], // toggled buttons
["blockquote", "code-block"],
["link", "image", "video"],
[{ header: 1 }, { header: 2 }], // custom button values
[{ list: "ordered" }, { list: "bullet" }, { list: "check" }],
[{ script: "sub" }, { script: "super" }], // superscript/subscript
[{ indent: "-1" }, { indent: "+1" }], // outdent/indent
[{ direction: "rtl" }], // text direction
[{ size: ["small", false, "large", "huge"] }], // custom dropdown
[{ header: [1, 2, 3, 4, 5, 6, false] }],
[{ color: [] }, { background: [] }], // dropdown with defaults from theme
[{ font: [] }],
[{ align: [] }],
["clean"] // remove formatting button
];
const quill = new Quill("#editor", {
modules: {
toolbar: toolbarOptions
},
theme: "snow"
});