[TYPO3-RTE] Avoiding stolen entities when switching between html code view and wysiwyg view?
Uschi Renziehausen
typo3news at otherone.de
Mon Jul 10 14:55:20 CEST 2006
Hello list,
I have been struggling with all those transformations for weeks now and
have been quite successful so far. I managed to convince t3 to treat DIV
and P elements separately (at some cost, though), and I can write ABOUT
html and xml elements even outside <pre>, but one problem remains
unsolved: No way to talk about entities.
It seems, that this time my enemy is not the central html parser, but
some magic done, when I am toggling between html code view and wysiwyg
mode and (as I suppose) also on save. This is what happens:
- In wysiwyg I write < (some of us do have to talk ABOUT entities!).
- I switch to code view and I see < where it should be &lt;
- Now, switching back to wysiwyg, I of course have <
I have read the documentation at least ten times now, but I still might
have missed something. I know that I can control, which elements shall
be removed on toggle or save and so on, but I did not find anything
about controlling what shall happen to entities.
Is there a configuration option or not, and if not, could it be added?
My rtehtmlarea (1.4.1) is still running in Demo mode (will take some
more time until I can switch to Advanced :)) and here is the config as
far as transformations are concerned (comments left in):
# Do not clean code pasted from word processors currently, because we
first have
# to find out what to clean! It is no good to just remove all
formatting, because
# authors will get frustrated when they have to format it all over again.
# Better try and remap what makes sense. On the TODO list!
RTE.default.enableWordClean = 0
# Still not really figured out, but with these settings we will be able
# to put html example code in inline elements.
# NOTE: This only counts for elements, but not for entities!
# Even on JS level there is some unwanted magic when switching between
# html code view and wysiwyg mode
RTE.default.proc.entryHTMLparser_db.htmlSpecialChars = 0
RTE.default.proc {
dontHSC_rte = 1
dontUndoHSC_db = 1
}
# Leave my DIVs and do NOT treat them as paragraphs!
# This can be done by hiding div and p from the central
# parser.
# Unfortunately this means, that <p> will also be stored
# in the database and there are no linebreaks left! No way out of this
# unless one writes a customized central parser!
RTE.default.proc.entryHTMLparser_db.tags.div.remap = box
RTE.default.proc.exitHTMLparser_db.tags.box.remap = div
RTE.default.proc.entryHTMLparser_db.tags.p.remap = para
RTE.default.proc.exitHTMLparser_db.tags.para.remap = p
RTE.default.proc.entryHTMLparser_rte = 1
RTE.default.proc.exitHTMLparser_rte = 1
# Elements generally allowed
# If you decide to keep your p and div elements on the way to the
database by
# mapping them to some fancy tag (here box and para), make sure that
those fancy
# tags are members of this list!
RTE.default.proc.allowTags = box, para, a, abbr, acronym, address,
blockquote, b, br,caption, cite, code, dfn, dl, dt, dd, div, em, h1, h2,
h3, h4, h5, h6, hr, i, img, kbd, li, link, ol, p, pre, q, sdfield, span,
strong, sub, sup, table, thead, tbody, tfoot, td, th, tr, tt, ul, var
RTE.default.proc.entryHTMLparser_db.allowTags < RTE.default.proc.allowTags
RTE.default.proc.entryHTMLparser_rte.allowTags < RTE.default.proc.allowTags
RTE.default.proc.exitHTMLparser_db.allowTags < RTE.default.proc.allowTags
RTE.default.proc.exitHTMLparser_rte.allowTags < RTE.default.proc.allowTags
# Make sure that the fancy elements box and para are in the list
# of allowedTagsOutside, because if not so, they will be wrapped
# in <p>-elements
RTE.default.proc.allowTagsOutside = hr, address, box, para
# I do not know why, but without the allowTagsOutside defined for
entryHTMLparser_rte
# and exitHTMLparser_rte the div-elements are preceded with <p></p>
after loading the
# content from the database for the first time, and if you then store
the content again,
# you end up with <p> </p>.
RTE.default.proc.exitHTMLparser_rte.allowTagsOutside <
RTE.default.proc.allowTagsOutside
RTE.default.proc.entryHTMLparser_rte.allowTagsOutside <
RTE.default.proc.allowTagsOutside
# Not sure yet. We will see
RTE.default.proc.entryHTMLparser_db.keepNonMatchedTags = 0
RTE.default.proc.HTMLparser_db.xhtml_cleaning = 1
Ciao, Uschi
More information about the TYPO3-project-rte
mailing list