In the daily operation of Anqi CMS, the flexible selection of content editing methods is a key factor in improving efficiency and the publishing experience.Many operations personnel explore after enabling the Markdown editor, and naturally, they will have a question: Will all the content we have published, including those created with the rich text editor before, be automatically rendered in Markdown format once this feature is activated?

The content processing mechanism of AnQiCMS

The Anqi CMS adopts a flexible strategy in handling website content. When we enter the 'Global Settings' in the background and go to the 'Content Settings' to enable the Markdown editor, it actually changes the contentInput and frontend renderingThe pattern of behavior, rather than directly modifying the stored content in the database.A new article created or edited will be written in Markdown syntax and, when rendered on the front end, the system will default to trying to convert it from Markdown to HTML for display.

Markdown editor enabling the impact on existing articles

It should be explicitly pointed out that enabling the Markdown editor will not automatically convert the existing content in your database, especially those created in rich text mode, into Markdown format.The Anqi CMS does not default to reversing the format of existing articles.

This means that if your old article content is stored in the database in the form of HTML (or HTML code generated by a rich text editor), when you globally enable the Markdown editor, the system will still treat the content of these old articles as text that needs to be processed on the frontend.At this time, the Markdown parser may attempt to interpret the original HTML code as Markdown syntax, which usually leads to abnormal display of the page, with code confusion, style disorder, and even some content not displayed correctly.For example, HTML tags may be output as plain text, or some special characters may be incorrectly escaped.

How to ensure that existing HTML content is displayed correctly

To avoid the above rendering issues, Anqi CMS provides fine-grained control options. Especially in template tags, when handlingContentfield'sarchiveDetailandcategoryDetailtags, it provides arenderThe parameter allows you to manually specify whether to convert content from Markdown to HTML.

In particular, when you enable the Markdown editor in the global settings, but the actual content of some articles is still HTML, you can call this content in the templateContentWhen setting the fieldrender=falseParameters to explicitly inform the system that it does not need to parse it as Markdown, but to output it as raw HTML instead. Conversely, for content that is confirmed to be in Markdown format, you can setrender=trueForce the conversion, or do not explicitly set it when the global Markdown editor is enabled.renderparameter, allowing the system to convert by default logic.

By using this flexible template tag parameter control, operators can render the content accurately according to the actual storage format of the content, effectively avoid abnormal display of content, ensure the compatibility of the website, and correctly display the content.

Suggestion for content format conversion

Considering the above mechanism, if you plan to fully switch from rich text editor to Markdown editor and also want all historical content to be managed and rendered in Markdown format, then a more proactive strategy may be required.This usually involves manually converting existing HTML content or using external tools to convert it to Markdown format and updating it to the database.Ensure thorough testing during the conversion process to ensure that the converted content is rendered correctly and maintains the integrity of the original information.renderThe parameter will be the key to ensure a smooth transition.


Frequently Asked Questions

After enabling the Markdown editor, will my old articles (written in rich text editor) display incorrectly?Yes, if your old article content is pure HTML and the Markdown editor is globally enabled after that, the system may try to interpret HTML code as Markdown, which usually leads to display confusion. You need to deal with these old articles in the template.ContentField usagerender=falseParameters to ensure they are rendered correctly as original HTML.

Does Anqi CMS have a built-in tool to batch convert existing HTML articles to Markdown?According to the existing document, Anqi CMS itself does not provide a built-in batch HTML to Markdown conversion tool.This means you may need to manually edit or use a third-party conversion tool to convert existing HTML content to Markdown format and then update it to the database.

Where can I findrender=falseThe specific usage of this parameter?You can find in the Anqi CMS template creation documenttag-/anqiapi-archive/142.htmlandtag-/anqiapi-category/152.htmlthese two files. In these documents, it will be explained in detailContenthow the fields cooperaterenderThe parameter controls the conversion of Markdown to HTML.