Tiddlywiki always "breaks" script tags rendered inside tiddlers displayed 
in the story-river and most translcusions as a security measure.

If you need the script included in the header portion of the HTML template 
used to render the whole page, tag the tiddler with "$:/tags/RawMarkup". 
This places the raw contents of the tiddler's text field in the header tag 
of the template. This requires that you Save and Reload your wiki.

If you use the other RawMarkupWikified tags ( $:/tags/RawMarkupWikified , 
$:/tags/RawMarkupWikified/TopBody, etc), then tiddlywiki tries to parse the 
text field of the tiddler so-tagged into "simple text" (stripping out HTML 
tags, etc). In order to prevent this, use a special "pragma line" at the 
top of the text field:

`\rules only filteredtranscludeinline transcludeinline` 

This restricts text-processing to only transcluded data. Also, "Note that 
the wiki must be saved and reloaded in order for a raw markup tiddler to 
take effect. Also note that global macros are not available by default 
within raw markup tiddlers; you can use the ImportVariablesWidget 
<https://tiddlywiki.com/prerelease/#ImportVariablesWidget> to explicitly 
import them."

I hope that helps.

Best,
Joshua Fontany
  

On Wednesday, September 30, 2020 at 8:29:29 AM UTC-7 digit...@gmail.com 
wrote:

> It is possible to have a tiddler with a <script> block as its contents and 
> transclude this into the templates/static.tiddler.html so that for example 
> I have code necessary for the comments section on each page rendered by 
> that template.
>
> However I cannot have an <script> block within a tiddler that is to be 
> rendered through that template, for example the one time, in document  code 
> necessary to embed a github gist that shows a block of code I am talking 
> about,  because it gets mangled into an unusable form in the process of 
> being rendered.  It seems like no matter how I try and put that <script> 
> code into the tiddler, be it by macro or transclusion, it still gets 
> 'neutered' in the rendering process.  This is what I would like to change.
>
> On Wednesday, September 30, 2020 at 12:20:38 AM UTC-4 TW Tones wrote:
>
>> Donald,
>>
>> I personally see no reason why not. TiddlyWiki itself uses raw system 
>> tags 
>> <https://tiddlywiki.com/#SystemTag%3A%20%24%3A%2Ftags%2FRawStaticContent> 
>> for 
>> a similar purpose. Includes insertion head/body etc... Which you could 
>> clone for scrips and styles.
>>
>> You will need to modify the static tiddler template to accommodate it, 
>> and you can transclude this content from another tiddler.
>>
>> However a longer lasting and sharable solution would be to provide a 
>> mechaisium within the static template, to accept this (and other values) 
>> from the source tiddler
>> eg a static-script field in source tiddlers could contain what is to be 
>> added between the script tags or a transclusion of a tiddler) thus the 
>> author can decide on a per-tiddler basis which static pages get custom 
>> scripts or styles.
>>
>> This would further support the use of Tiddlywiki as a site generator.
>>
>> Regards
>> TW Tones.
>>
>>
>> On Wednesday, 30 September 2020 11:32:28 UTC+10, Donald Coates wrote:
>>>
>>> Is it possible to have <script> tags and allow them to be rendered in a 
>>> static page?  I understand the security issues for inside a tiddler, but 
>>> when rendered as an html page it would be useful.
>>>
>>> Thank you.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b3902227-b44f-4c61-9701-cd5cc11976can%40googlegroups.com.

Reply via email to