diff --git a/core/modules/parsers/wikiparser/rules/html.js b/core/modules/parsers/wikiparser/rules/html.js index fcf691530..0d294a989 100644 --- a/core/modules/parsers/wikiparser/rules/html.js +++ b/core/modules/parsers/wikiparser/rules/html.js @@ -47,8 +47,8 @@ exports.parse = function() { this.nextTag = null; // Advance the parser position to past the tag this.parser.pos = tag.end; - // Check for a following linebreak - var hasLineBreak = !tag.isSelfClosing && !!this.parseTokenRegExp(this.parser.source,this.parser.pos,/(\r?\n)/g); + // Check for an immediately following double linebreak + var hasLineBreak = !tag.isSelfClosing && !!this.parseTokenRegExp(this.parser.source,this.parser.pos,/(\r?\n\r?\n)/g); // Set whether we're in block mode tag.isBlock = this.is.block || hasLineBreak; // Parse the body if we need to diff --git a/core/ui/AlertTemplate.tid b/core/ui/AlertTemplate.tid index 601275409..e65e7d442 100644 --- a/core/ui/AlertTemplate.tid +++ b/core/ui/AlertTemplate.tid @@ -3,6 +3,8 @@ title: $:/core/ui/AlertTemplate
<$button message="tw-delete-tiddler" class="btn-invisible">{{$:/core/images/delete-button}}
<$view field="component"/> - <$view field="modified" format="date" template="0hh:0mm:0ss DD MM YYYY"/> <$reveal type="nomatch" state="!!count" text="">(count: <$view field="count"/>)
+ <$transclude/> +
diff --git a/core/ui/ControlPanel/Appearance/Palette.tid b/core/ui/ControlPanel/Appearance/Palette.tid index 4e3638bbf..6da9336fa 100644 --- a/core/ui/ControlPanel/Appearance/Palette.tid +++ b/core/ui/ControlPanel/Appearance/Palette.tid @@ -3,13 +3,19 @@ tags: $:/tags/ControlPanel/Appearance caption: {{$:/language/ControlPanel/Appearance/Palette/Caption}} \define lingo-base() $:/language/ControlPanel/Appearance/Palette/ + {{$:/snippets/paletteswitcher}} <$reveal type="nomatch" state="$:/state/ShowPaletteEditor" text="yes"> + <$button set="$:/state/ShowPaletteEditor" setTo="yes"><> - -<$reveal type="match" state="$:/state/ShowPaletteEditor" text="yes"> -<$button set="$:/state/ShowPaletteEditor" setTo="no"><> -{{$:/snippets/paletteeditor}} + + + +<$reveal type="match" state="$:/state/ShowPaletteEditor" text="yes"> + +<$button set="$:/state/ShowPaletteEditor" setTo="no"><> +{{$:/snippets/paletteeditor}} + diff --git a/core/ui/EditTemplate/body.tid b/core/ui/EditTemplate/body.tid index 44ff94f1b..fb80c55b9 100644 --- a/core/ui/EditTemplate/body.tid +++ b/core/ui/EditTemplate/body.tid @@ -3,17 +3,28 @@ tags: $:/tags/EditTemplate \define lingo-base() $:/language/EditTemplate/ <$reveal state="$:/ShowEditPreview" type="match" text="yes"> + <> <$button type="set" set="$:/ShowEditPreview" setTo="no"><> +
+ <$transclude /> +
+
<$edit field="text" class="tw-edit-texteditor" placeholder={{$:/language/EditTemplate/Body/Placeholder}}/> +
+
+ + <$reveal state="$:/ShowEditPreview" type="nomatch" text="yes"> + <> <$button type="set" set="$:/ShowEditPreview" setTo="yes"><> <$edit field="text" class="tw-edit-texteditor" placeholder={{$:/language/EditTemplate/Body/Placeholder}}/> + diff --git a/core/ui/MoreSideBar/Tags.tid b/core/ui/MoreSideBar/Tags.tid index d320a67ce..2a81da962 100644 --- a/core/ui/MoreSideBar/Tags.tid +++ b/core/ui/MoreSideBar/Tags.tid @@ -3,7 +3,11 @@ tags: $:/tags/MoreSideBar caption: {{$:/language/SideBar/Tags/Caption}} <$list filter="[tags[]sort[title]]"> + <$transclude tiddler="$:/core/ui/TagTemplate"/> <$count filter="[is[current]tagging[]]"/> + + ---- + {{$:/core/ui/UntaggedTemplate}} <$count filter="[untagged[]!is[system]] -[tags[]]"/> diff --git a/core/ui/PageMacros.tid b/core/ui/PageMacros.tid index 45db04806..e86f9922e 100644 --- a/core/ui/PageMacros.tid +++ b/core/ui/PageMacros.tid @@ -10,11 +10,12 @@ title: $:/core/ui/PageMacros
<$list filter="$tabsList$" variable="currentTab"><$button set=<> setTo=<> default="$default$" selectedClass="tw-tab-selected"><$transclude tiddler=<> field="caption"><$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/>
-
-
+
+ <$list filter="$tabsList$" variable="currentTab"> <$reveal type="match" state=<> text=<> default="$default$"> + <$transclude tiddler=<>/> diff --git a/core/ui/PageTemplate/sidebar.tid b/core/ui/PageTemplate/sidebar.tid index 210d10173..2440b6216 100644 --- a/core/ui/PageTemplate/sidebar.tid +++ b/core/ui/PageTemplate/sidebar.tid @@ -2,11 +2,14 @@ title: $:/core/ui/PageTemplate/sidebar tags: $:/tags/PageTemplate
+ + diff --git a/core/ui/ViewTemplate/body.tid b/core/ui/ViewTemplate/body.tid index 4d07820d1..1e182c5df 100644 --- a/core/ui/ViewTemplate/body.tid +++ b/core/ui/ViewTemplate/body.tid @@ -2,5 +2,7 @@ title: $:/core/ui/ViewTemplate/body tags: $:/tags/ViewTemplate
+ <$transclude /> +
\ No newline at end of file diff --git a/editions/test/tiddlers/tests/test-wikitext-parser.js b/editions/test/tiddlers/tests/test-wikitext-parser.js index 4c2a481fa..67bbad0ce 100644 --- a/editions/test/tiddlers/tests/test-wikitext-parser.js +++ b/editions/test/tiddlers/tests/test-wikitext-parser.js @@ -83,16 +83,26 @@ describe("WikiText parser tests", function() { [ { type : 'element', tag : 'p', children : [ { type : 'element', tag : 'div', isBlock : false, attributes : { attribute : { type : 'indirect', name : 'attribute', textReference : 'Tiddler Title!!field', start : 4, end : 39 } }, children : [ { type : 'text', text : 'some text' } ], start : 0, end : 40 } ] } ] ); - expect(parse("
\nsome text
")).toEqual( + expect(parse("
\n\nsome text
")).toEqual( [ { type : 'element', start : 0, attributes : { attribute : { start : 4, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 38 } }, tag : 'div', end : 39, isBlock : true, children : [ { type : 'element', tag : 'p', children : [ { type : 'text', text : 'some text' } ] } ] } ] ); - expect(parse("
\nsome text
")).toEqual( + expect(parse("
\n\nsome text
")).toEqual( [ { type : 'element', tag : 'p', children : [ { type : 'element', start : 0, attributes : { }, tag : 'div', end : 5, isBlock : false, children : [ { type : 'element', start : 5, attributes : { attribute : { start : 9, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 43 } }, tag : 'div', end : 44, isBlock : true, children : [ { type : 'element', tag : 'p', children : [ { type : 'text', text : 'some text' } ] } ] } ] } ] } ] ); + expect(parse("
\n\n!some heading
")).toEqual( + + [ { type : 'element', tag : 'p', children : [ { type : 'element', start : 0, attributes : { }, tag : 'div', end : 5, isBlock : false, children : [ { type : 'element', start : 5, attributes : { attribute : { start : 9, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 43 } }, tag : 'div', end : 44, isBlock : true, children : [ { type : 'element', tag : 'h1', attributes : { class : { type : 'string', value : '' } }, children : [ { type : 'text', text : 'some heading
' } ] } ] } ] } ] } ] + + ); + expect(parse("
\n!some heading
")).toEqual( + + [ { type : 'element', tag : 'p', children : [ { type : 'element', start : 0, attributes : { }, tag : 'div', end : 5, isBlock : false, children : [ { type : 'element', start : 5, attributes : { attribute : { start : 9, name : 'attribute', type : 'indirect', textReference : 'TiddlerTitle!!field', end : 43 } }, tag : 'div', end : 44, isBlock : false, children : [ { type : 'text', text : '\n!some heading' } ] } ] } ] } ] + + ); }); it("should parse macro definitions", function() { diff --git a/editions/tw5.com/tiddlers/HelloThere.tid b/editions/tw5.com/tiddlers/HelloThere.tid index 8fc1b65bc..b053f68e8 100644 --- a/editions/tw5.com/tiddlers/HelloThere.tid +++ b/editions/tw5.com/tiddlers/HelloThere.tid @@ -11,6 +11,7 @@ This is version <> of ~TiddlyWiki, a major reboot designed [[for the ne //~TiddlyWiki is a free, open source project that depends on [[your love and support|HelpingTiddlyWiki]] for its survival//.
+ {{TiddlyWiki Classic.png}} !! TiddlyWikiClassic - http://classic.tiddlywiki.com diff --git a/editions/tw5.com/tiddlers/ReleaseHistory.tid b/editions/tw5.com/tiddlers/ReleaseHistory.tid index 7d16a762b..773e6cd77 100644 --- a/editions/tw5.com/tiddlers/ReleaseHistory.tid +++ b/editions/tw5.com/tiddlers/ReleaseHistory.tid @@ -6,11 +6,17 @@ type: text/vnd.tiddlywiki Here are the details of recent releases of TiddlyWiki5. See [[TiddlyWiki5 Versioning]] for details of how releases are named. <$list filter="[tag[releasenote]!sort[created]]"> +
+

<$link to={{!!title}}><$view field="title"/>

''Release date: <$view field="released" format="date" template="DDth MMM YYYY at 0hh:0mm">TBA''
+ <$transclude/> +
+
+ \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/Upgrading.tid b/editions/tw5.com/tiddlers/Upgrading.tid index 84fe5a870..9b206a4eb 100644 --- a/editions/tw5.com/tiddlers/Upgrading.tid +++ b/editions/tw5.com/tiddlers/Upgrading.tid @@ -7,6 +7,7 @@ type: text/vnd.tiddlywiki There are several methods for upgrading an existing TiddlyWiki version 5 document to a new release. There is a [[different procedure|Upgrading TiddlyWiki on Node.js]] for upgrading [[TiddlyWiki on Node.js]].
+ {{TiddlyWiki Classic.png}} !! Upgrading from TiddlyWikiClassic diff --git a/editions/tw5.com/tiddlers/mechanisms/HistoryMechanism.tid b/editions/tw5.com/tiddlers/mechanisms/HistoryMechanism.tid index 6a8d1ce83..9cf70d8b9 100644 --- a/editions/tw5.com/tiddlers/mechanisms/HistoryMechanism.tid +++ b/editions/tw5.com/tiddlers/mechanisms/HistoryMechanism.tid @@ -19,5 +19,7 @@ The history list also maintains the field ''current-tiddler'' that contains the Which renders the same as the "Open" sidebar tab, with the addition of a tick against the tiddler that was last navigated to. <$list filter="[list[$:/StoryList]]" history="$:/HistoryList" storyview="pop"> + <$button message="tw-close-tiddler" class="btn-invisible btn-mini">× <$link to={{!!title}}><$view field="title"/> <$reveal type="match" state="$:/HistoryList!!current-tiddler" text=<>>✓ + diff --git a/editions/tw5.com/tiddlers/wikitext/HTML in WikiText.tid b/editions/tw5.com/tiddlers/wikitext/HTML in WikiText.tid index 310509586..160808d68 100644 --- a/editions/tw5.com/tiddlers/wikitext/HTML in WikiText.tid +++ b/editions/tw5.com/tiddlers/wikitext/HTML in WikiText.tid @@ -1,5 +1,5 @@ created: 20131205160816081 -modified: 20131205160828313 +modified: 20140220203440064 tags: wikitext title: HTML in WikiText type: text/vnd.tiddlywiki @@ -13,6 +13,8 @@ This is my nice and simple block of text. HelloThere ``` +! Attributes + Attributes in HTML tags can be specified as a transclusion or a macro invocation. For example, here the value of the `href` attribute will be set to the value of the tiddler MyLinkDestination: ``` @@ -24,3 +26,8 @@ Here an attribute is specified as a macro invocation: ``` >>link ``` + +! Content Parsing + +The content of an HTML element will be parsed in inline mode unless the opening tag is followed by two linebreaks. (Inline mode means that block mode formatting such as tables, lists and headings is not recognised). + diff --git a/editions/tw5.com/tiddlers/wikitext/Widgets in WikiText.tid b/editions/tw5.com/tiddlers/wikitext/Widgets in WikiText.tid index f7b54b7f9..e96d20aef 100644 --- a/editions/tw5.com/tiddlers/wikitext/Widgets in WikiText.tid +++ b/editions/tw5.com/tiddlers/wikitext/Widgets in WikiText.tid @@ -1,10 +1,28 @@ created: 20131205160840915 -modified: 20131205161336125 +modified: 20140220203320110 tags: wikitext title: Widgets in WikiText type: text/vnd.tiddlywiki -Widgets provide rich functionality within WikiText. +Widgets provide rich functionality within WikiText. They have the same syntax as [[HTML elements|HTML in WikiText]], but the tag name always starts with `$`. For example: + +``` +<$button message="tw-close-tiddler">Close Me! +``` + +Note that widgets inherit all the features of [[HTML in WikiText]]: + +* Widget attributes can be specified as: +** Unquoted strings (that cannot contain spaces) +** Strings quoted with single or double quotes +** Macro invocations (eg `attr=<>`) +** Transclusions (eg, `attr={{MyTiddler!!field}}`) +* The content of a widget is parsed in inline mode unless the opening tag is followed by two linebreaks, which forces block mode +** 'Inline mode' means that 'block mode' parse rules like headings, tables and lists are not recognised + +See [[HTML in WikiText]] for more details. + +The available widgets include: <$list filter="[tag[widget]sort[title]]"/>