mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
parent
b37a356b5e
commit
a5afed9384
@ -30,10 +30,14 @@ ElementWidget.prototype.render = function(parent,nextSibling) {
|
||||
this.parentDomNode = parent;
|
||||
this.computeAttributes();
|
||||
// Neuter blacklisted elements
|
||||
this.tag = this.parseTreeNode.tag || "span";
|
||||
this.tag = this.parseTreeNode.tag;
|
||||
if($tw.config.htmlUnsafeElements.indexOf(this.tag) !== -1) {
|
||||
this.tag = "safe-" + this.tag;
|
||||
}
|
||||
// Restrict tag name to digits, letts and dashes
|
||||
this.tag = this.tag.replace(/[^0-9a-zA-Z\-]/mg,"");
|
||||
// Default to a span
|
||||
this.tag = this.tag || "span";
|
||||
// Adjust headings by the current base level
|
||||
var headingLevel = ["h1","h2","h3","h4","h5","h6"].indexOf(this.tag);
|
||||
if(headingLevel !== -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user