1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-24 18:47:20 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/wikitext/HTML in WikiText.tid

54 lines
1.6 KiB
Plaintext
Raw Normal View History

caption: HTML
created: 20131205160816081
modified: 20160622112259272
2014-09-11 08:15:58 +00:00
tags: WikiText
title: HTML in WikiText
type: text/vnd.tiddlywiki
HTML tags and comments can be used directly in WikiText. For example:
```
<article class="hello">
This is my nice and simple block of text. HelloThere
<!-- This comment will not appear in the wikified output -->
</article>
```
2014-10-18 18:15:04 +00:00
! Content Parsing
The content of an HTML element will be parsed in inline mode unless the opening tag is followed by two linebreaks, in which case it is parsed in block mode. (Inline mode means that block mode formatting such as tables, lists and headings is not recognised).
! Attributes
2014-10-18 18:15:04 +00:00
Attributes in HTML tags can be specified as a literal, 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:
```
2016-07-05 17:06:52 +00:00
<a href={{MyLinkDestination}} rel="noopener noreferrer">link</a>
```
2016-07-05 17:06:52 +00:00
Note that the link should have the `rel` attribute set to `noopener noreferrer` to maintain privacy of the URLs of private TiddlyWiki's (eg on Dropbox). See https://mathiasbynens.github.io/rel-noopener/ for more information.
Here an attribute is specified as a macro invocation:
```
2016-07-05 17:06:52 +00:00
<a href=<<MyMacro "Brian">> rel="noopener noreferrer">link</a>
```
2014-06-19 11:37:54 +00:00
Literal attribute values can include line breaks. For example:
```
<div data-address="Mouse House,
Mouse Lane,
Rodentville,
Ratland."/>
```
By using triple-double quotes you can specify attribute values that include single double quotes. For example:
```
<div data-address="""Mouse House,
"Mouse" Lane,
Rodentville,
Ratland."""/>
```