HTMLQuoteHTML

Tinderbox Icon


Attribute Data Type:   boolean
Attribute Default Value:   false
Atrribute Group:   HTML
Attribute Inherited from Preferences?     No
Attribute Read-Only?   No

If set to true, any valid HTML mark-up in the source text of the of the current note will be rendered as text (i.e. exported as entities) instead of as HTML code. For HTML mark-up you can read any code written within in <> angle brackets (XML, PHP, etc.).

Thus, a true setting exports a '<br>' in the source text as '<br>' that shows as screen text whereas a false setting exports it as '
', i.e. a HTML source code line break like you see here between the apostrophes.

Values exported via ^get()^ and ^getFor()^ will be parsed for HTML entities in addition to note text.

When set to true, where sections of mark-up include line breaks in the Tinderbox note, it does not output the line returns after each line of code - i.e. they form continuous text in the HTML output - unless the there is at least one character at the beat the beginning or end of the line outside the code within <> characters. In addition, the normal space character (spacebar) and Tab characters do not count for this purpose. Thus text in the TBX source like:

<key>Value1</key>

<key>Value2</key> 

renders on one line in the output:

<key>Value1</key><key>Value2</key> 

So, how then to form a line break in the HTML output without adding visible unwanted text? If you add an Option+space character to the end of the first code line in the source text:

<key>Value1</key>[opt+space] 

<key>Value2</key> 

... the (visible) HTML output result is formatted on two lines with no extraneous tags:

<key>Value1</key> 

<key>Value2</key> 

You can put this special space entity at the beginning or end. to trigger thel ines to be output as paragrpahs. If you want some lines of code indented, just use several &nbsp; thus:

&nbsp;&nbsp;&nbsp;<key>Value1</key>

For control over whether any mark-up at all is applied to source text during HTML export, see the HTMLMarkupText attribute.

To assist with the export of code samples in notes, Tinderbox recognises the <code></code> tag pair and exports the tags and all code between them verbatim when HTMLQuoteTML is set to false; the app's expectation is the user will provide CSS styling of the <code> element. As the <code> element is omitted unchanged this should allow for styling variations by applying ID or class values. To preserve line returns in code samples include the CSS rule for <code> - "white-space: pre;". This both honours line ends and white space exactly.

The next 2 examples are both code snippets indented with 5 spaces in the note source text, first without <code>:

$MyAttribute = "house"

$MyNumber = 1

...and here with <code> mark-up:

$MyAttribute = "house"

$MyNumber = 1

The output is seen on the web page in monospace font, but all on one line. However, if you want the white space and line ends in the source to be respected use <pre> as well:

     $MyAttribute  =  "house"
     $MyNumber  =  1

Note however, that the same limitation as described above for note text lines beginning with < and ending in > still applies to auto-handled <code></code> sections when on a single line. The cleanest method to resolve the conflicting output results for a single line sample is to end the line with an Opt+space character. That results in the line being wrapped in <p> tags. Even better, if you start the line with a Tab character, the output will use the HTML set in your HTML View paragraph preferences for indented paragraphs.

Also see the note on Exporting code samples.


Up: Boolean Attributes
Previous: HTMLOverwriteImages  Next: IsPrototype 

[Last updated: 14 Dec 2009, using v5.0]

Google search aTbRef for:  

Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]

Creative Commons License

Made with Tinderbox