Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8880131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:06:26+00:00 2026-06-14T20:06:26+00:00

I want to display code through <pre> and/or <code> tags, which works fine. White

  • 0

I want to display code through <pre> and/or <code> tags, which works fine. White spaces are saved on first save and displayed properly in the front-end. However, when reloading the content in the backend, the editor shows the code without the additional whitespaces. Saving again drops the whole code formatting.

I assume there is some setting for this but I couldn’t find anything until now. Any hints on this?

For the code highlighting, I am using the GeshiLib and vjrtecodesnippetsextensions.

Edit:

Sorry, missed the configuration. There is the basic rtehtmlarea involved, currently v4.7.5, there is no TCA specific change since it is a standard bodytext field from TYPO3’s standard Text content element (displayed through css_styled_content).

PageTS for the RTE looks like the following:

RTE.default.hidePStyleItems := removeFromList(pre)
RTE.default.proc {
  allowTags := addToList(pre)
  entryHTMLparser_db.allowTags < RTE.default.proc.allowTags

  overruleMode = tx_vjrtecodesnippets,ts_css,cleanenc
  allowTags := addToList(code)
  allowTagsOutside := addToList(code)

  entryHTMLparser_db {
    allowTags < RTE.default.proc.allowTags
    allowTagsOutside < RTE.default.proc.allowTagsOutside
  }

  HTMLparser_rte {
    allowTags < RTE.default.proc.allowTags
    allowTagsOutside < RTE.default.proc.allowTagsOutside
  }
}

Edit2: We’ve published the TYPO3 extension news_blog which does exactly this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:06:27+00:00Added an answer on June 14, 2026 at 8:06 pm

    I wanted to write a comment, but a short answer with sophisticated guesses might be just as good:

    • I checked at my own site, the <code> tag works fine. Whitespaces
      are stored as &nbsp; in the bodytext field, therefore preserved
      when saved and re-opened.
    • Have you tried deleting the line
      RTE.default.hidePStyleItems := removeFromList(pre)?
    • According to the manual, only <code> tags are supported by vjrtecodesnippets. Do you really need both tags for syntax highlighting?
    • Also, have you tried changing your PageTS like follows to enable <pre>?:

    –

    RTE.default.proc {
      allowTagsOutside := addToList(code,pre)
    }
    

    EDIT:
    I found a related TypoScript snippet, which might be noteworthy for your case. Please try making the following adjustments:

    In the Template SETUP section:

    lib.parseFunc.allowTags := addToList(code,pre)
    lib.parseFunc_RTE.allowTags := addToList(code,pre)
    

    In the PAGE TSconfig:

    RTE.default.proc {
      allowTags := addToList(code,pre)
      allowTagsOutside := addToList(code,pre)
      overruleMode = tx_vjrtecodesnippets,ts_css,cleanenc
    
      // CONTENT TO DATABASE
      HTMLparser_rte {
        allowTags < RTE.default.proc.allowTags
        allowTagsOutside < RTE.default.proc.allowTagsOutside
      }
    
      // Entry HTML parser
      entryHTMLparser_db {
        allowTags < RTE.default.proc.allowTags
        allowTagsOutside < RTE.default.proc.allowTagsOutside
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display html code just like what your see here. <textarea><script id=ff>gdgdgs</script></textarea>
I want display data from database in Listbox...Here is my code, It is not
For the most part, when I want to display some HTML code to be
In my code,I want to display TextView text name as Toast message. I do
I want to display data from database in DataGridView...This is my code...Its not working...Can
i want to display a list in more columns with 5 items/column my code
I want to display the number of products on home page . My code
I want to display the last March month. I am using the following code,
Using VB.NET I want to display the date in datetimepicker from the database. Code.
Below is my code snippet , I want to display only 10 records from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.