Need help getting rid of iframe

170 views
Skip to first unread message

Robert Payne

unread,
Feb 26, 2021, 11:19:12 AM2/26/21
to TiddlyWiki
Can someone tell me what needs to be done to make text/html content render in the tiddler body, rather than rending using an iframe?

PMario

unread,
Feb 26, 2021, 6:19:14 PM2/26/21
to TiddlyWiki
On Friday, February 26, 2021 at 5:19:12 PM UTC+1 rpayn...@gmail.com wrote:
Can someone tell me what needs to be done to make text/html content render in the tiddler body, rather than rending using an iframe?

There is no iframe in the tiddler body "view mode".

The edit mode iframe can only be removed, if you don't want to use the keyboard shortcuts _and_ the toolbar buttons.
The iframe there is needed to keep the text "selection" active while clicking a toolbar button. ... Which basically means, that it can't be removed atm.

There are some PRs pending, which may allow us to remove the iframe. BUT they are not merged and it's not clear if they ever will.

-mario

PMario

unread,
Feb 26, 2021, 6:20:16 PM2/26/21
to TiddlyWiki
Hi,
What do you want to achieve?
-m

Jeremy Ruston

unread,
Feb 27, 2021, 4:50:26 AM2/27/21
to TiddlyWiki Group
Hi Robert, pmario

I think Robert is talking about the iframe that is used to display tiddlers with the type “text/html”.

The reason is that “text/html” is the content type of an entire HTML document, and the only way to reliably display an entire HTML document is an iframe.

If your text is in fact fragments of HTML then one can usually use the native TiddlyWiki type “text/vnd.tiddlywiki” since most HTML elements are interpreted correctly by the wikitext parser. That technique doesn’t work for script tags, or event handlers, though.

As mario says, the best approach depends what you’re trying to achieve.

Best wishes

Jeremy


--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/64d899ab-bcae-4223-99a8-50882cefc6afn%40googlegroups.com.

Robert Payne

unread,
Feb 27, 2021, 10:25:58 PM2/27/21
to TiddlyWiki
Hi All,

Jeremy, you are exactly right.
I want to remove the iframe used to display tiddlers with the type "text/html".
My client wants to be able to create/edit content using only the editor for text/html.
He finds switching the content type to “text/vnd.tiddlywiki” before saving a tiddler  too burdensome.
He has tasked me with making text/html content render without using an iframe.
I was thinking that I might be able to change the logic that picks the rendering of text/html so that it uses the rendering routine used for text/vnd.tiddlywiki.
But, I have not been able to pinpoint where that happens.
Thanks for any help you can provide.

--Robert

strikke...@gmail.com

unread,
Feb 28, 2021, 12:51:44 AM2/28/21
to TiddlyWiki
I might be totally out in the woods here, but I remember that http://bjtools.tiddlyspot.com/
 experimented with formats for the VisualEditor. The format named: text/x-perimental and the description: html with TW markup.

Birthe

Eric Shulman

unread,
Feb 28, 2021, 12:58:02 AM2/28/21
to TiddlyWiki
On Saturday, February 27, 2021 at 7:25:58 PM UTC-8 rpayn...@gmail.com wrote:
My client wants to be able to create/edit content using only the editor for text/html. He finds switching the content type to “text/vnd.tiddlywiki” before saving a tiddler  too burdensome. 

When creating/editing a tiddler, the only difference between the default (text/vnd.tiddlywiki) and HTML (text/html) interface are the editor toolbar buttons, nearly all of which are applicable only for native TiddlyWiki wikitext parsing anyway.
Since your client only intends to use HTML syntax, I suggest completely disabling the editor toolbar (see $:/ControlPanel tiddler, Settings tab, Editor Toolbar section, "show editor toolbar" checkbox).
Then, if you leave the "type" field blank, the content rendering will default to using the "text/vnd.tiddlywiki" wikitext parser for which, as Jeremy has already noted, most HTML elements are interpreted correctly
Thus, your client can completely ignore the content type field value and won't ever need to switch it before saving a tiddler.

The only potential issue would be if the client inadvertently uses wikitext formatting syntax, such as doubled slashes for //italics// or doubled single-quotes for ''bold''.
On the other hand, a benefit of using the default wikitext parser is that links to other tiddlers can be easily entered using doubled square brackets [[like this]].

-e

Robert Payne

unread,
Mar 1, 2021, 1:20:20 PM3/1/21
to TiddlyWiki
Hi All,  

I solved the whole thing by borrowing code from the VisualEditor plugin that added the x-htmlp custom content type.
The user is able to add content using the summernote editor, another visual editor for which I made a plugin.
After the user saves the tiddler, the content renders without the iframe.

A personal thanks to Birthe for pointing me to the solution.

--Robert

Mat

unread,
Mar 1, 2021, 4:41:37 PM3/1/21
to TiddlyWiki
Robert, would this by any chance make it possible to view files that are separate from the TW file, and have the seen content interact with the surrounding TW? For example, to view a text file that has the text "foo [[bar]] baz" and the [[bar]] is a working link to the bar tiddler? (As you can tell, I desperately need to find a bar because I'm thirsty.)

<:-)

Robert Payne

unread,
Mar 2, 2021, 1:54:27 PM3/2/21
to TiddlyWiki
Matt, it does not make it possible to view files that are separate from the TW file.
Reply all
Reply to author
Forward
0 new messages