Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions core/modules/parsers/wikiparser/rules/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,11 @@ exports.parse = function() {
// Move the caption to the first row if it isn't already
if(table.children.length !== 1) {
table.children.pop(); // Take rowContainer out of the children array
table.children.splice(0,0,rowContainer); // Insert it at the bottom
table.children.unshift(rowContainer); // Insert it at the top
}
// Set the alignment - TODO: figure out why TW did this
// rowContainer.attributes.align = rowCount === 0 ? "top" : "bottom";
// If the caption WikiText is before any table rows, show it above the table
// Otherwise, show it below the table
rowContainer.attributes.align = rowCount === 0 ? "top" : "bottom";
// Parse the caption
rowContainer.children = this.parser.parseInlineRun(rowTermRegExp,{eatTerminator: true});
} else {
Expand Down
24 changes: 24 additions & 0 deletions editions/tw5.com/tiddlers/releasenotes/5.4.0/#9803.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
title: $:/changenotes/5.4.0/#9803
description: Re-enable WikiText table caption positioning
release: 5.4.0
tags: $:/tags/ChangeNote
change-type: enhancement
change-category: usability
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9803
github-contributors: andrewg_oz

Re-enable positioning of WikiText table captions by un-commenting-out original code. The way it works is:

```
|caption above table|c
|!h1|!h2|h
|d1|d2|
```

and

```
|!h1|!h2|h
|d1|d2|
|caption below table|c
```
Loading