Initial Commit

This commit is contained in:
Jeremy Ruston
2026-01-23 22:23:48 +00:00
parent eb3a80968e
commit 9aaab87b87
2 changed files with 23 additions and 0 deletions

View File

@@ -42,6 +42,11 @@ ElementWidget.prototype.render = function(parent,nextSibling) {
headingLevel = Math.min(Math.max(headingLevel + 1 + baseLevel,1),6);
this.tag = "h" + headingLevel;
}
// Check for element mapping
var mappedTag = this.getVariable("tv-map-" + this.tag);
if(mappedTag) {
this.tag = mappedTag.trim();
}
// Select the namespace for the tag
var XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml",
tagNamespaces = {

View File

@@ -0,0 +1,18 @@
title: ElementMapping/Basic
description: Mapping one element to another
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\whitespace trim
<!-- Map <p> to <div> -->
\define tv-map-p() div
This is a paragraph
+
title: ExpectedResult
<div>This is a paragraph</div>