diff --git a/core/modules/parsers/wikiparser/rules/macrodef.js b/core/modules/parsers/wikiparser/rules/macrodef.js index 59e82433d..439bb2683 100644 --- a/core/modules/parsers/wikiparser/rules/macrodef.js +++ b/core/modules/parsers/wikiparser/rules/macrodef.js @@ -58,7 +58,7 @@ exports.parse = function() { var reEnd; if(this.match[3]) { // If so, the end of the body is marked with \end - reEnd = /(\r?\n\\end[^\S\n\r]*(?:$|\r?\n))/mg; + reEnd = new RegExp("(\\r?\\n\\\\end[^\\S\\n\\r]*(?:" + $tw.utils.escapeRegExp(this.match[1]) + ")?(?:$|\\r?\\n))","mg"); } else { // Otherwise, the end of the definition is marked by the end of the line reEnd = /($|\r?\n)/mg; diff --git a/core/ui/ControlPanel/Basics.tid b/core/ui/ControlPanel/Basics.tid index dd5580ad5..46df7e77c 100644 --- a/core/ui/ControlPanel/Basics.tid +++ b/core/ui/ControlPanel/Basics.tid @@ -20,16 +20,15 @@ caption: {{$:/language/ControlPanel/Basics/Caption}} \end \whitespace trim -|tc-max-width tc-edit-max-width|k |<> |''<>'' | |<$link to="$:/SiteTitle"><> |<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> | |<$link to="$:/SiteSubtitle"><> |<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> | |<$link to="$:/status/UserName"><> |<$edit-text tiddler="$:/status/UserName" default="" tag="input"/> | |<$link to="$:/config/AnimationDuration"><> |<$edit-text tiddler="$:/config/AnimationDuration" default="" tag="input"/> | -|<$link to="$:/DefaultTiddlers"><> |<>
<$edit class="tc-edit-texteditor" tiddler="$:/DefaultTiddlers"/>
//<>// | +|<$link to="$:/DefaultTiddlers"><> |<>
<$edit tag="textarea" tiddler="$:/DefaultTiddlers" class="tc-edit-texteditor"/>
//<>// | |<$link to="$:/language/DefaultNewTiddlerTitle"><> |<$edit-text tiddler="$:/language/DefaultNewTiddlerTitle" default="" tag="input"/> | |<$link to="$:/config/NewJournal/Title"><> |<$edit-text tiddler="$:/config/NewJournal/Title" default="" tag="input"/> | -|<$link to="$:/config/NewJournal/Text"><> |<$edit tiddler="$:/config/NewJournal/Text" class="tc-edit-texteditor" default=""/> | +|<$link to="$:/config/NewJournal/Text"><> |<$edit tiddler="$:/config/NewJournal/Text" tag="textarea" class="tc-edit-texteditor" default=""/> | |<$link to="$:/config/NewTiddler/Tags"><> |<$vars currentTiddler="$:/config/NewTiddler/Tags" tagField="text">{{||$:/core/ui/EditTemplate/tags}}<$list filter="[tags[]] +[limit[1]]" variable="ignore"><$button tooltip={{$:/language/ControlPanel/Basics/RemoveTags/Hint}}><><$action-listops $tiddler=<> $field="text" $subfilter={{{ [get[tags]] }}}/><$action-setfield $tiddler=<> tags=""/> | |<$link to="$:/config/NewJournal/Tags"><> |<$vars currentTiddler="$:/config/NewJournal/Tags" tagField="text">{{||$:/core/ui/EditTemplate/tags}}<$list filter="[tags[]] +[limit[1]]" variable="ignore"><$button tooltip={{$:/language/ControlPanel/Basics/RemoveTags/Hint}}><><$action-listops $tiddler=<> $field="text" $subfilter={{{ [get[tags]] }}}/><$action-setfield $tiddler=<> tags=""/> | |<$link to="$:/config/AutoFocus"><> |{{$:/snippets/minifocusswitcher}} | diff --git a/editions/prerelease/tiddlers/Release 5.2.4.tid b/editions/prerelease/tiddlers/Release 5.2.4.tid index aec127496..8b13c27b9 100644 --- a/editions/prerelease/tiddlers/Release 5.2.4.tid +++ b/editions/prerelease/tiddlers/Release 5.2.4.tid @@ -7,6 +7,12 @@ type: text/vnd.tiddlywiki //[[See GitHub for detailed change history of this release|https://github.com/Jermolene/TiddlyWiki5/compare/v5.2.3...master]]// +<<.banner-credits + credit:"""Congratulations to [[dmikh|https://talk.tiddlywiki.org/u/dmikh]] for their winning design for the banner for this release (here is the [[competition thread|https://talk.tiddlywiki.org/t/new-release-banner-competition-for-v5-2-4/4982]] and the [[voting thread|https://talk.tiddlywiki.org/t/vote-for-the-v5-2-4-new-release-banner/5140/2]]). +""" + url:"https://raw.githubusercontent.com/Jermolene/TiddlyWiki5/0dc30086e933cf2272cddb076a9fcbedad252735/editions/tw5.com/tiddlers/images/New%20Release%20Banner.png" +>> + ! Plugin Improvements * New [[Twitter Archivist|./editions/twitter-archivist]] plugin to imports the tweets and associated media from a Twitter Archive as individual tiddlers diff --git a/editions/test/tiddlers/tests/data/macros/NestedMacros.tid b/editions/test/tiddlers/tests/data/macros/NestedMacros.tid new file mode 100644 index 000000000..d5f854d0c --- /dev/null +++ b/editions/test/tiddlers/tests/data/macros/NestedMacros.tid @@ -0,0 +1,36 @@ +title: Macros/NestedMacros +description: Nested Macros +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Output + +\whitespace trim + +\define outer() +\whitespace trim + +\define middle() +\whitespace trim + +\define inner() +\whitespace trim + +Jaguar + +\end inner + +<> + +\end middle + +<> + +\end outer + +<> + ++ +title: ExpectedResult + +

Jaguar

\ No newline at end of file diff --git a/editions/tw5.com/tiddlers/Tables in WikiText CSS Utility Classes.tid b/editions/tw5.com/tiddlers/Tables in WikiText CSS Utility Classes.tid deleted file mode 100644 index 14abc1c86..000000000 --- a/editions/tw5.com/tiddlers/Tables in WikiText CSS Utility Classes.tid +++ /dev/null @@ -1,81 +0,0 @@ -created: 20220817153236691 -modified: 20221010074314452 -tags: [[Tables in WikiText]] -title: Tables in WikiText CSS Utility Classes -type: text/vnd.tiddlywiki - -~WikiText tables can be styled by applying CSS classes. For basic information on wiktext tables and how to style them, see [[Tables in WikiText]]. - -{{Table Classes, Captions, Headers and Footers}} - -As seen above, the resulting table is left aligned and grows to fit the content. This is the browser default layout behaviour for tables. To get another behaviour, various CSS classes can be added into the "`k` row". - -! Utility Classes - -{{Utility Classes}} - -! Examples - -The following examples apply the style classes to tables but the "General Utility Classes" can as well be used on DIVs or other [[HTML block elements|HTML Block Elements]] - -!! Centred Table - -To center a table horizontally, use `tc-center`: - -<> - -!! Centred Table, 80% Width - -To add empty left and right margins to a table that is otherwise full-tiddler-width, you can use `tc-max-width-80` - -<> | -|<<.lorem>> |Cell4 | -|Header|Header|h -""">> - -!! Table with Maximum Width - -To expand a table to full tiddler width, use `tc-max-width` - -<> - -!! Table with First Column Minimum Width - -The following example shows a simple "form" where the first columns width is adjusted to its content by means of `tc-first-col-min-width` - -< | -|Cell3 |<$edit-text tiddler="$:/temp/test-table-input" field="text"/> | -""">> - -!! Table with Maximum Width ~TextWidgets - -Here, the previous "form" is styled further to give the [[TextWidget]]s full width by adding the class `tc-edit-max-width` - -< | -|Cell3 |<$edit-text tiddler="$:/temp/test-table-input" field="text"/> | -""">> - -!! Table with No Borders - -The following is a table with maximum width. It contains [[TextWidget]]s with maximum width. The first column is set to be minimum width. Further, all links in the first column are set to __not__ line break (wrap) regardless of window resize. - -< | -|^ [[Link to a tiddler]]
some more text|<$edit-text tiddler="$:/temp/test-table-input" field="text"/> | -""">> diff --git a/editions/tw5.com/tiddlers/definitions/HTML Block Elements.tid b/editions/tw5.com/tiddlers/definitions/HTML Block Elements.tid deleted file mode 100644 index 373ce9b45..000000000 --- a/editions/tw5.com/tiddlers/definitions/HTML Block Elements.tid +++ /dev/null @@ -1,9 +0,0 @@ -created: 20220818091959523 -modified: 20220818092101307 -tags: Definitions -title: HTML Block Elements -type: text/vnd.tiddlywiki - -<<< -HTML (Hypertext Markup Language) elements historically were categorized as either "block-level" elements or "inline-level" elements. Since this is a presentational characteristic it is nowadays specified by CSS in the Flow Layout. A Block-level element occupies the entire horizontal space of its parent element (container), and vertical space equal to the height of its contents, thereby creating a "block". -<<< https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements diff --git a/editions/tw5.com/tiddlers/wikitext/Macro Definitions in WikiText.tid b/editions/tw5.com/tiddlers/wikitext/Macro Definitions in WikiText.tid index 1570e001a..9e3d9d1fe 100644 --- a/editions/tw5.com/tiddlers/wikitext/Macro Definitions in WikiText.tid +++ b/editions/tw5.com/tiddlers/wikitext/Macro Definitions in WikiText.tid @@ -4,4 +4,4 @@ tags: title: Macro Definitions in WikiText type: text/vnd.tiddlywiki -See [[Macro Definitions]]. \ No newline at end of file +See [[Macro Definitions]]. diff --git a/editions/tw5.com/tiddlers/wikitext/Table Classes Captions Headers and Footers.tid b/editions/tw5.com/tiddlers/wikitext/Table Classes Captions Headers and Footers.tid deleted file mode 100644 index 9e09827a2..000000000 --- a/editions/tw5.com/tiddlers/wikitext/Table Classes Captions Headers and Footers.tid +++ /dev/null @@ -1,20 +0,0 @@ -created: 20220819100636227 -modified: 20220819101309072 -tags: [[Tables in WikiText]] -title: Table Classes, Captions, Headers and Footers -type: text/vnd.tiddlywiki - -Table CSS classes, captions, headers and footers can be specified as special pseudo-rows. The following example: - -* `|myclass anotherClass|k` assigns the CSS classes "myclass" and "anotherClass" to the table -* `|This is a caption |c` gives the table the caption "This is a caption" -* `|Header|Header|h` adds a header row of cells with the text "Header" -* `|Footer|Footer|f` adds a footer row of cells with the text "Footer" - -<> diff --git a/editions/tw5.com/tiddlers/wikitext/Tables in WikiText.tid b/editions/tw5.com/tiddlers/wikitext/Tables in WikiText.tid index c7af206d7..9c1d83ed4 100644 --- a/editions/tw5.com/tiddlers/wikitext/Tables in WikiText.tid +++ b/editions/tw5.com/tiddlers/wikitext/Tables in WikiText.tid @@ -1,6 +1,6 @@ caption: Tables created: 20130914132100000 -modified: 20220819103416274 +modified: 20220513115945053 tags: WikiText title: Tables in WikiText type: text/vnd.tiddlywiki @@ -66,7 +66,17 @@ To merge a table cell with the one above, use the special cell text `~`. To merg ! Table Classes, Captions, Headers and Footers -{{Table Classes, Captions, Headers and Footers}} +Table CSS classes, captions, headers and footers can be specified as special pseudo-rows. The following example: +* assigns the CSS classes "myclass" and "anotherClass" to the table +* gives the table the caption "This is a caption" +* adds a header row of cells with the text "Header" +* adds a footer row of cells with the text "Footer" -More examples can be found at: [[Tables in WikiText CSS Utility Classes]] +<> diff --git a/editions/tw5.com/tiddlers/wikitext/Utility Classes.tid b/editions/tw5.com/tiddlers/wikitext/Utility Classes.tid deleted file mode 100644 index 4a291e34b..000000000 --- a/editions/tw5.com/tiddlers/wikitext/Utility Classes.tid +++ /dev/null @@ -1,20 +0,0 @@ -created: 20220818093624828 -modified: 20221010074235929 -tags: WikiText -title: Utility Classes -type: text/vnd.tiddlywiki - -<<.from-version "5.2.4">> The following outlines a few predefined CSS classes intended to make it simpler to style [[HTML block-elements|HTML Block Elements]] and [[wikitext tables|Tables in WikiText CSS Utility Classes]]. - -!! General Utility Classes - -|`tc-center` |Centres a block-element to the middle of the container | -|`tc-max-width `|Expands a block-element to use the maximum width of the container | -|`tc-max-width-80`|Sets the width of a block-element to use 80% of the maximum container width. This setting is useful with the `tc-center` class | -|`tc-edit-max-width `|Expands [[TextWidget]]s to use the maximum available width. See [[ControlPanel -> Info -> Basics|$:/core/ui/ControlPanel/Basics]]| -|`tc-first-link-nowrap` |Ensures that any links in the first table column will never wrap to the next line | - -!! Table Utility Classes - -|`tc-table-no-border` |Removes the borders of a table | -|`tc-first-col-min-width` |The first column of a table will take up minimal possible width. It adapts to the content | diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 026b8b9da..2fdd08fb9 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -326,7 +326,7 @@ table { } table th, table td { - padding: 4px 6px 4px 6px; + padding: 0 7px 0 7px; border-top: 1px solid <>; border-left: 1px solid <>; } @@ -357,36 +357,11 @@ Table utility classes width: 1%; } -/* -** Utility classes work well with tables but also for other containers -*/ - /* First link A element will not wrap */ .tc-first-link-nowrap:first-of-type a { white-space: nowrap; } -/* Move the table to the center of the container */ -.tc-center { - margin-left: auto; - margin-right: auto; -} - -.tc-max-width { - width: 100%; -} - -.tc-max-width-80 { - max-width: 80%; -} - -/* Allow input and textarea to look like the ControlPanel inputs */ -.tc-edit-max-width input, -.tc-edit-max-width textarea { - width: 100%; - padding: 3px; -} - /* CSV parser plugin */