Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
problem with class attrib from custom .css
tobias
This is on TST5.5.2 and Windows:
I want to give the author the opportunity to highlight text in a textarea. Therefore I've created a custom .css file containing the following:
.highlight {font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
font-weight: normal;
color: #4B6CBF;}
Now when the user selects text and selects "highlight" from the select box, the text's style is changed, unless the selection is longer than one line. In that case an empty paragraph tag (
<p> </p>
) is inserted before the selected text, but the text's style remains unchanged. Also, no <p class...> tag is inserted in this case.
I've tried to autoclean the <p> and </p> tags via the VF config file but this doesn't work either.
Any ideas?
Find more posts tagged with
Comments
Gregg Faus
I'm using the same environment as you and stuffed this class onto one my existing custom css files. It worked just fine, either when selecting text in one line or multiple lines.
The HTML that was created as a result included <span> tags, not paragraph tags w/ classes.
Are you removing any tags or attributes in the autoclean?
tobias
Strange!
When I check the HTML (using the textarea's context menu) there's no <span> tag around the highlighted text, when the selected text begins at the start of one line and ends at the end of another line. However, in the textarea the text is shown with the correct color (in WYSIWYG mode).
Even stranger:
If I select text beginning in the middle of line one and ending in the middle of line 2, it is highlighted correctly, the HTML shows the correct <span> tags, but the remainder of line one and line two appear on one line before the highlighted text.
Gregg, what's the HTML code of an empty newly created textarea on your system? Is it
<p> </p>
as in mine?
Even if I use the <autoclean> feature to get rid of all paragraph tags, a new line containing a space is inserted in front of the selected and highlighted text.
PS: My autoclean contains the following (mainly to get rid of unnecessary MSOffice tags):
<attribute>style</attribute>
<attribute>height</attribute>
<attribute>x:str</attribute>
<tagonly>col</tagonly>
These shouldn't interfere with the <span class="..."> tags, should they?
Gregg Faus
What does your entire clean section look like? This is what mine is:
<clean charencode="entityname" cr="cr" lf="lf" preferfonttag="false" reducetags="true">
<remove>
<tagelement>script</tagelement>
<attribute>style</attribute>
<attribute>class="MsoNormal"</attribute>
<attribute>class="MsoBodyTextIndent"</attribute>
<tagonly>font</tagonly>
<tagonly>div</tagonly>
<tagonly>h1</tagonly>
<tagonly>h2</tagonly>
<tagonly>h3</tagonly>
<tagonly>h4</tagonly>
<tagonly>h5</tagonly>
<tagonly>h6</tagonly>
<tagonly>st1
treet</tagonly>
<tagonly>st1
lace</tagonly>
<tagonly>st1:address</tagonly>
<tagonly>st1
laceName</tagonly>
<tagonly>st1
laceType</tagonly>
<tagonly>st1:date</tagonly>
<tagonly>st1:time</tagonly>
<tagonly>st1
tate</tagonly>
</remove>
</clean>
When a load a new DCR I do not have any HTML code in the VF field (unlike you).