elfuchsjekyll / vosao

Automatically exported from code.google.com/p/vosao
0 stars 0 forks source link

ckedit trims space after ${} expressions #143

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
(This may be a ckeditor issue, but I thought we start by filing it here first.)

What steps will reproduce the problem?
1. See staging.vosao.org/test/escaping
2. Edit page to add space after ${} expressions
3. Save and review pages. Spaces disappear.

The same thing happens when ${} is not escaped. 

What is the expected output? What do you see instead?

The editor should not trim a single space after ${}.

Staying in source mode may help, but it shouldn't happen at all. 

Original issue reported on code.google.com by ted.husted on 3 Mar 2010 at 10:39

GoogleCodeExporter commented 9 years ago
Implemented ckeditor skip of escaped Velocity expressions. 

\${test("param")} will be escaped and be shown on ckeditor with double quotes
replaced by " and Velocity will skip it.

${test("param")} will stay untouched and will be processed by Velocity.

ckeditor always removes spaces so insert   instead if you need one.

Original comment by kinyelo@gmail.com on 4 Mar 2010 at 12:06

GoogleCodeExporter commented 9 years ago
For escaping expression 

${service.findContent("page")}

use

${esc.d}{service.findContent("page")}

Original comment by kinyelo@gmail.com on 6 Mar 2010 at 1:34

GoogleCodeExporter commented 9 years ago
On <http://staging.vosao.org/test/escaping>, this works, but in the editor the 
dollar
sign is not rendered. It does render correcting on the site, just not in the 
editor. 

When switching between source and display mode, the editor interjects a tab 
between
{esc.d} and {service ... 

It does render correctly in the end, but the behavior is going to generate 
questions :) 

-Ted. 

(Since people are bound to ask, why {esc.d} ?

$${esc.d}{service.findContent("/path/to/page")}

Without the second $, the editor put a tab between ${esc.d} and {service ...}, 
and
the $ wasn't rendered in 

Original comment by thusted%...@gtempaccount.com on 6 Mar 2010 at 4:03

GoogleCodeExporter commented 9 years ago
In 2.0.4, {esc.d} renders a dollar sign in the site version, but doesn't 
display it
in the editor. Is that intentional?

I also noticed that in 2.0.4, just bolding the command keeps it from being
interpreted. I don't know if that's a feature or a strange side effect.

<p>
<strong>$service.findPageChildren("/blog")</strong>
</p>

renders without interpretation in bold. 

If the bold approach isn't "wrong", since I'm bolding commands anyway, I'd 
rather use
that approach.  

Original comment by ted.husted on 9 Mar 2010 at 10:24

GoogleCodeExporter commented 9 years ago
$service.findPageChildren("/blog") renders without interpretation because
it's wrong Velocity expression.

this will run ${service.findPageChildren("/blog")}

For addressing this "dollar" issue we can add flag to the page "Velocity 
processing"
it can control interpretation. What do you think?

Original comment by kinyelo@gmail.com on 10 Mar 2010 at 11:47

GoogleCodeExporter commented 9 years ago
A flag for page content might be best, since there is also the # statements to 
escape. 

There is also the case where an Admin might not want Authors including Velocity
Commands in content. 

Can we default Velocity Processing off, so that people who want commands in 
pages
have to turn it on?

Original comment by thusted....@gmail.com on 10 Mar 2010 at 2:43

GoogleCodeExporter commented 9 years ago
Implemented "VelocityProcessing", removed ckeditor converting double quotes.

Original comment by kinyelo@gmail.com on 10 Mar 2010 at 5:58

GoogleCodeExporter commented 9 years ago
Can we upgrade staging to version 0.3? 

I'm at the point where I'm documenting the Velocity command, and using this 
feature
now would save a lot rework. 

Original comment by thusted....@gmail.com on 10 Mar 2010 at 7:01

GoogleCodeExporter commented 9 years ago
Done. Please check if all on it's place.

Original comment by kinyelo@gmail.com on 10 Mar 2010 at 8:29

GoogleCodeExporter commented 9 years ago
Everything is there. Thanks. I'm looking forward to the additions in 0.3. 

-Ted.

Original comment by ted.husted on 10 Mar 2010 at 9:38