Zum Inhalt springen

Htmlarea: entfernen von Tags

Erstellt am 21. Dezember 2005 · 1 Antwort · letzte Antwort am 21. Dezember 2005

Tags: Frage

headcrap ·

Hi,

ich möchte den Editor so einstellen, dass "bestimmte" HTML Tags wie z.B. font,strong und b entfernt werden.
Hierfür habe ich folgende TS erstellt (abgeändert):

RTE.config.tt_content.bodytext {
    proc {
        denyTags = font,size,b,/b,</b>
        entryHTMLparser_db {
            removeTags = font,size,b,/b,</b>
            tags {
                li {
                    allowedAttribs = class
                    }
                p {
                    allowedAttribs = class
                    }
                h1 {
                    allowedAttribs = class
                    }
                h2 {
                    allowedAttribs = class
                    }
                }
            }
        }
    }
RTE.default {
    proc {
        RTE.default.contentCSS = fileadmin/screen.css
        RTE.default.useCSS = 1
        overruleMode = ts_css
        dontConvBRtoParagraph = 1
        allowTagsOutside =
        allowTagsInTypolists =
        allowTags =
        denyTags = font,size,b,/b,</b>
        keepPDIVattribs = align,class,style
        HTMLparser_db = 1
        HTMLparser_db {
        htmlSpecialChars = 1
            xhtml_cleaning = 1
            noAttrib = b,i,u,strike,sub,sup,strong,em,quote,blockquote,cite,tt,br,center
            keepNonMatchedTags = protect
            tags.b.remap = 
            tags.i.remap =  
            removeTags = font,size,b,/b,</b>
        }
        entryHTMLparser_db = 1
        entryHTMLparser_db {
        htmlSpecialChars = 1
            removeTags = font,size,b,/b,</b>
            keepNonMatchedTags = 1
            xhtml_cleaning = 1
            noAttrib = b,i,u,strike,sub,sup,strong,em,quote,blockquote,cite,tt,br,center
            tags {
                li {
                    allowedAttribs = class
                    }
                p {
                    allowedAttribs = class
                    }
                h1 {
                    allowedAttribs = class
                    }
                h2 {
                    allowedAttribs = class
                    }
                 }
            }
        }
  enableWordClean = 1
  removeComments = 1

  useCSS = 1
  defaultLinkTarget = _self
  defaultStil {
   page = internal-link
   url  = external-link
   file = external-link
  }
  showStatusBar = 1
  showButtons = *
  hideButtons = About,emoticon,fontstyle,fontsize,formatblock,strikethrough,underline,lefttoright,righttoleft,textcolor,bgcolor,textindicator,user,inserttag,showhelp,chMode,outdent,indent,left, center, right, justifyfull, blockstylelabel, blockstyle, textstylelabel, textstyle,spellcheck,image
  hidePStyleItems = H1,H3,H4,H5,H6,PRE
  hideFontSizes = *
  hideTags = b,</b>
  disableColorPicker = 1
  classesCharacter = quote, highlight, deprecated
  HTMLAreaPluginList = SpellChecker, ContextMenu, FindReplace
  HTMLAreaPspellMode = normal
}
RTE.classesAnchor {
externalLink {
        class = external-link-new-window
        type = url
        image = 
        altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.php:external_link_altText
        titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.php:external_link_titleText
}
externalLinkInNewWindow {
        class = external-link-new-window
        type = url
        image =
        altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.php:external_link_new_window_altText
        titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.php:external_link_new_window_titleText
}
internalLink {
        class = internal-link
        type = page
        image = 
        altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.php:internal_link_altText
        titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.php:internal_link_titleText
}
internalLinkInNewWindow {
        class = internal-link-new-window
        type = page
        image = 
        altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.php:internal_link_new_window_altText
        titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.php:internal_link_new_window_titleText
}
download {
        class = download
        type = file
        image = 
        altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.php:download_altText
        titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.php:download_titleText
}
mail {
        class = mail
        type = mail
        image = 
        altText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.php:mail_altText
        titleText = LLL:EXT:rtehtmlarea/htmlarea/plugins/TYPO3Browsers/locallang.php:mail_titleText
}
}

Nun werden, wenn gespeichert folgende Tags rausgeworfen:

<font> <b> <strong>

JEDOCH bleiben davon die schließenden Tags übrig
d.h. </font> </b> </strong> stehen weiterhin in meinem HTML Code ...

Hat jemand eine Idee wieso, weshalb und warum der HTMLArea das macht ? (oder ich das falsch eingestellt habe)

Ich nutze version 0.76 des HTMLAreas

gruss
headcrap

woida ·

Folgender Code funktioniert bei mir (htmlarea 1.0)

RTE.default.proc {
    dontConvBRtoParagraph = 1
    allowTags = table, tbody, tr, th, td, h1, h2, h3, p, br,  ul, ol, li, pre, blockquote, strong, em, b, i, u, sub, sup, strike, a, img, nobr, hr, center,  tt, q, cite, abbr, acronym
    denyTags = font, h6, h5, h4, div, bgcolor, span

HTMLparser_db = 1
  HTMLparser_db {
    allowTags < RTE.default.proc.allowTags
    denyTags < RTE.default.proc.denyTags
  }
  exitHTMLparser_rte = 1
  exitHTMLparser_rte {
    allowTags < RTE.default.proc.allowTags
    denyTags < RTE.default.proc.denyTags
  }

  entryHTMLparser_db = 1
  entryHTMLparser_db {
     allowTags < RTE.default.proc.allowTags
     denyTags < RTE.default.proc.denyTags
     tags.h1.remap = h2 # h1 wird nach h2 umgewandelt
   }
}