Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new classes to wikitext created emphasised elements to make them easily stylable #8163

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions core/modules/parsers/wikiparser/rules/codeinline.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ exports.parse = function() {
tag: "code",
children: [{
type: "text",
attributes: {
class: {type: "string", value: "tc-emphasis tc-code"}
},
text: text,
start: start,
end: this.parser.pos
Expand Down
3 changes: 3 additions & 0 deletions core/modules/parsers/wikiparser/rules/emphasis/bold.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ exports.parse = function() {
return [{
type: "element",
tag: "strong",
attributes: {
class: {type: "string", value: "tc-emphasis tc-strong"}
},
children: tree
}];
};
Expand Down
4 changes: 4 additions & 0 deletions core/modules/parsers/wikiparser/rules/emphasis/italic.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ exports.parse = function() {
return [{
type: "element",
tag: "em",
attributes: {
class: {type: "string", value: "tc-emphasis tc-italic"}
},

children: tree
}];
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ exports.parse = function() {
return [{
type: "element",
tag: "strike",
attributes: {
class: {type: "string", value: "tc-emphasis tc-strike"}
},
children: tree
}];
};
Expand Down
3 changes: 3 additions & 0 deletions core/modules/parsers/wikiparser/rules/emphasis/subscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ exports.parse = function() {
return [{
type: "element",
tag: "sub",
attributes: {
class: {type: "string", value: "tc-emphasis tc-sub"}
},
children: tree
}];
};
Expand Down
3 changes: 3 additions & 0 deletions core/modules/parsers/wikiparser/rules/emphasis/superscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ exports.parse = function() {
return [{
type: "element",
tag: "sup",
attributes: {
class: {type: "string", value: "tc-emphasis tc-sup"}
},
children: tree
}];
};
Expand Down
3 changes: 3 additions & 0 deletions core/modules/parsers/wikiparser/rules/emphasis/underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ exports.parse = function() {
return [{
type: "element",
tag: "u",
attributes: {
class: {type: "string", value: "tc-emphasis tc-underscore"}
},
children: tree
}];
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ $param$ with a ''buffalo''
+
title: ExpectedResult

<p>Going to lunch with a ''buffalo''</p><p>Going to breakfastwith a<strong>buffalo</strong></p><p>Going to dinner with a <strong>buffalo</strong></p>Going to lunch with a ''buffalo''Going to breakfastwith abuffaloGoing to dinner with a buffalo
<p>Going to lunch with a ''buffalo''</p><p>Going to breakfastwith a<strong class="tc-emphasis tc-strong">buffalo</strong></p><p>Going to dinner with a <strong class="tc-emphasis tc-strong">buffalo</strong></p>Going to lunch with a ''buffalo''Going to breakfastwith abuffaloGoing to dinner with a buffalo
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ title: ExpectedResult

! Not Heading

Text with <strong>bold</strong><h1 class="">Heading</h1><p>Text with <strong>bold</strong></p><p>! Not Heading
Text with <strong class="tc-emphasis tc-strong">bold</strong><h1 class="">Heading</h1><p>Text with <strong class="tc-emphasis tc-strong">bold</strong></p><p>! Not Heading

Text with <strong>bold</strong><h1 class="">Heading</h1><p>Text with <strong>bold</strong></p>
Text with <strong class="tc-emphasis tc-strong">bold</strong><h1 class="">Heading</h1><p>Text with <strong class="tc-emphasis tc-strong">bold</strong></p>
</p>
4 changes: 2 additions & 2 deletions editions/test/tiddlers/tests/data/pragmas/Parsermode.tid
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ title: ExpectedResult

! Not Heading

Text with <strong>bold</strong><h1 class="">Heading</h1><p>Text with <strong>bold</strong></p><p>! Not Heading
Text with <strong class="tc-emphasis tc-strong">bold</strong><h1 class="">Heading</h1><p>Text with <strong class="tc-emphasis tc-strong">bold</strong></p><p>! Not Heading

Text with <strong>bold</strong><h1 class="">Heading</h1><p>Text with <strong>bold</strong></p>
Text with <strong class="tc-emphasis tc-strong">bold</strong><h1 class="">Heading</h1><p>Text with <strong class="tc-emphasis tc-strong">bold</strong></p>
</p>
6 changes: 3 additions & 3 deletions editions/test/tiddlers/tests/data/transclude/Typed.tid
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ testindex: This is ''wikitext''
+
title: ExpectedResult

<p>This is <strong>wikitext</strong>
<p>This is <strong class="tc-emphasis tc-strong">wikitext</strong>
-
<pre><code>This is ''wikitext''</code></pre></p><p>This is <strong>wikitext</strong>
<pre><code>This is ''wikitext''</code></pre></p><p>This is <strong class="tc-emphasis tc-strong">wikitext</strong>
-
<pre><code>This is ''wikitext''</code></pre></p><p>This is <strong>wikitext</strong>
<pre><code>This is ''wikitext''</code></pre></p><p>This is <strong class="tc-emphasis tc-strong">wikitext</strong>
-
<pre><code>This is ''wikitext''</code></pre></p>
5 changes: 5 additions & 0 deletions themes/tiddlywiki/vanilla/base.tid
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,11 @@ a.tc-tiddlylink-external:hover {
color: <<colour tiddler-link-background>>;
}

/* wikitext bold for ''[[internal link]]'' */
strong.tc-strong .tc-tiddlylink {
font-weight: bolder;
}

/*
** Drag and drop styles
*/
Expand Down
Loading