mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-25 03:14:41 +00:00
Initial Commit
This commit is contained in:
@@ -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 = {
|
||||
|
||||
18
editions/test/tiddlers/tests/data/element-mapping/Basic.tid
Normal file
18
editions/test/tiddlers/tests/data/element-mapping/Basic.tid
Normal 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>
|
||||
Reference in New Issue
Block a user