Feature Proposal: Add a little UI to make it easier to escape TML

Motivation

I find that I frequently write Foswiki Markup in a text editor, and then mechanically replace % with $percnt, " with \", etc if I need to put the markup inside and %IF macro, for example. This feature proposal is to add a little UI to the 'Edit wiki text' editor, to make it easier to do this transformations.

Description and Documentation

This could be implemented using a %TWISTY to keep the UI clean. It could even go under the existing "Edit help" twisty. Possible UI:

TML:

Examples

Impact

WhatDoesItAffect? : %WHATDOESITAFFECT%

Implementation

TML: Escape Un Escape

-- Contributors: KipLubliner - 20 Feb 2012

Discussion

Great idea. I've often wanted something similar. We should look into doing a http://codemirror.net/ editor

-- PaulHarvey - 23 Oct 2011

you know, this should be a pretty easy thing to add to the ComponentEditContrib? TinyMCE? plugin demo i made - it would be pretty cool..

-- SvenDowideit - 24 Oct 2011

I think this would be a great thing to do for 1.2..... all we need is a committed developer.

-- CrawfordCurrie - 17 Feb 2012

Sven - this is the only page that shows up if I google for ComponentEditContrib. Is that TinyMCE? plugin accessible anywhere?

-- MichaelTempest - 18 Feb 2012

Well I do have commit access now, so I could commit to working on this. But I'm not sure about what is the best way to do so. If someone posts an implementation plan, I will set my name.

-- KipLubliner - 19 Feb 2012

I would personally do it entirely in Javascript.

-- CrawfordCurrie - 20 Feb 2012

As it turned out, I need this right now ... so I whipped it up (see Implementation section)

-- KipLubliner - 20 Feb 2012

Nice one! Though I suggest you move the functions into the foswiki namespace and give them more intention-revealing names (escape and unescape are rather general) e.g. foswiki.escapeTML and foswiki.unescapeTML. I can see them being useful in other places.

-- CrawfordCurrie - 21 Feb 2012

Very nice smile ... but I think there is a bug. I think backslashes also need to be (un)escaped.

-- MichaelTempest - 21 Feb 2012

Michael, I implemented unescape(\") → " What additional transformations should be included?

-- KipLubliner - 22 Feb 2012

Based on the list of format $tokens in FormattedSearch, I think you have all that is needed. Nice smile

-- MichaelTempest - 22 Feb 2012
Topic revision: 24 Feb 2012, KipLubliner
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads