Markdown text automatic conversion method and device, medium and program product

By using python-docx and win32com in collaboration, an automatic conversion method for Markdown text to Word documents is generated, solving the problems of automatic table of contents updates and page number standardization, and improving document processing efficiency and quality.

CN120909562APending Publication Date: 2025-11-07BEIJING SCI & TECH PATENT OFFICE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511098083.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-06
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing Markdown text conversion methods do not support automatic table of contents updates and have high code complexity, especially since manual operation is required when generating the table of contents.

Method used

The Python-docx engine generates a basic Word document, including a cover, body, and table of contents placeholders. The Win32com engine loads a temporary docx file, identifies and releases the table of contents placeholder space, inserts the actual table of contents, and refreshes the association between the table of contents titles and page numbers in real time.

Benefits of technology

It enables automatic conversion of Markdown text to Word documents, supports automatic updating of the table of contents and standardized page number format, and improves document processing efficiency and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120909562A_ABST
    Figure CN120909562A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic Markdown text conversion method and device, a medium and a program product, and the method comprises the steps: firstly analyzing a Markdown text to be converted by using a python-docx engine, and generating a basic Word document which comprises a cover, a text and a directory placeholder; then the basic Word document is stored as a temporary docx file; and then loading a temporary docx file by utilizing a win32com engine, identifying and releasing a space of a directory placeholder, inserting a real directory into the space of the directory placeholder, and refreshing an association relationship between a directory title and a page number in real time to obtain a converted document. According to the method, the advantages of Python-docx and win32com are integrated, so that automatic conversion from a Markdown text to a Word document with an automatic update directory and a standard page format is realized, and the document processing efficiency and quality are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of document processing, and in particular to a Markdown text automatic conversion method, device, medium and program product. BACKGROUND

[0002] In the programming implementation based on Python, commonly used libraries for generating automatic documents include win32com and python-docx.

[0003] Python-docx has strong cross-platform capability and can better support the parsing of markdown text, but the support of Python-docx for Word native styles (such as directory styles and page number formats) is limited, especially when generating a directory, the automatic update of the directory is not supported and needs to be manually operated by the user.

[0004] The implementation code based on Win32com has higher complexity and is only available for windows, and depends on the installed Office version.

[0005] Therefore, it is urgent to invent a Markdown text automatic conversion method to solve the problems of the existing Markdown text conversion method that does not support the update of the directory and high code complexity. SUMMARY

[0006] Therefore, the embodiments of the present application provide a Markdown text automatic conversion method, device, medium and program product, which at least partially solve the problems in the prior art.

[0007] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.

[0008] In order to achieve the above-mentioned purpose, the embodiments of the present application provide the following technical solutions:

[0009] According to a first aspect of the embodiments of the present application, a Markdown text automatic conversion method is provided, and the method comprises:

[0010] The Markdown text to be converted is parsed by using a python-docx engine to generate a basic Word document, and the basic Word document includes a cover, a main text and a directory placeholder area;

[0011] The basic Word document is saved as a temporary docx file;

[0012] The temporary docx file is loaded by using a win32com engine, a directory placeholder space is identified and released, a real directory is inserted into the directory placeholder space, a real-time refresh is performed on the association between a directory title and a page number, and a converted document is obtained.

[0013] Further, the Markdown text to be converted is parsed by using a python-docx engine to generate a basic Word document, including:

[0014] An initial Word document with customized styles is created by calling an instruction Document(), and the customized styles include a body text style and a title style of each level;

[0015] A standardized cover is generated by combining structured elements in a cover area of the initial Word document, and the standardized cover includes a title area, an author area and a date area;

[0016] A page break is inserted at the end of the cover by using an instruction add_page_break() to perform a page setting;

[0017] A directory placeholder is created for the initial Word document, and the directory placeholder includes a directory title paragraph and a placeholder paragraph;

[0018] A preset temporary placeholder is inserted into the placeholder paragraph, and the preset temporary placeholder is used to be replaced by a real directory;

[0019] A section break is inserted into the directory placeholder by using an instruction add_section(), so that the directory placeholder is separated from a body area;

[0020] According to a parsing result of a body of the Markdown text to be converted, a Word body is generated in the body area of the initial Word document to obtain the basic Word document.

[0021] Further, according to a parsing result of a body of the Markdown text to be converted, a Word body is generated in the body area of the initial Word document, including:

[0022] In the body area of the initial Word document, according to a number of preset symbols in each title text in the Markdown text corresponding to the initial Word document, each title text is mapped to each outline level of the initial Word document, and a title is generated in the initial Word document.

[0023] According to the line head mark of the list text in the Markdown text corresponding to the initial Word document, the unordered list item is identified, and according to the unordered list item, the instruction add_paragraph (style = 'List Bullet') is called to generate a bulleted list in the initial Word document;

[0024] The Markdown table syntax of the table text in the Markdown text corresponding to the initial Word document is parsed, and a Word table is generated in the initial Word document according to the parsing result.

[0025] For the normal paragraph in the Markdown text corresponding to the initial Word document except the title, list and table, the corresponding normal paragraph text is generated by calling the instruction add_paragraph (), and the normal paragraph text is formatted according to the predefined style.

[0026] Further, the standardized cover is generated by combining the structural elements, including:

[0027] The title paragraph is set in the title area by using the instruction add_heading (level = 0), and the author area and the date area are set by calling the instruction doc.add_paragraph ();

[0028] The page break symbol is inserted at the end of the standardized cover by using the instruction add_page_break () to set the page.

[0029] Further, the basic Word document is saved as a temporary docx file, including:

[0030] The basic Word document is saved as a temporary docx file by using the instruction doc.save (self.temp_docx), and the temporary docx file includes complete outline structure and format information.

[0031] Further, the method further includes:

[0032] The section list of the loaded temporary docx file is obtained by doc.Sections;

[0033] The footer text of the cover area and the table of contents placeholder area corresponding to the section list is emptied;

[0034] The main footer is positioned by Footers (wdHeaderFooterPrimary) and the page code field is inserted, and the page code format is configured.

[0035] Further, a directory placeholder area space is identified and released, a real directory is inserted into the directory placeholder area space, a real-time refresh is performed on the association between a directory title and a page number, and a converted document is obtained, including:

[0036] A preset temporary placeholder in a document paragraph of the loaded temporary docx file is found through traversal;

[0037] The preset temporary placeholder is deleted by using an instruction para.Range.Delete();

[0038] A real directory is inserted into the placeholder area corresponding to the preset temporary placeholder by using an instruction TablesOfContents.Add(), and a directory parameter is set;

[0039] The association between the directory title and the page number is refreshed in real time by using an instruction toc.Update();

[0040] The file after the real directory is inserted is saved as the converted document.

[0041] According to a second aspect of the embodiment of the present application, a Markdown text automatic conversion device is provided, and the device includes a processor and a memory;

[0042] The memory is used to store one or more program instructions;

[0043] The processor is used to run the one or more program instructions to perform the steps of the Markdown text automatic conversion method according to any one of the above.

[0044] According to a third aspect of the embodiment of the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the Markdown text automatic conversion method according to any one of the above.

[0045] According to a fourth aspect of the embodiment of the present application, a computer program product is provided, and the computer program product includes a computer program stored on a non-transitory computer readable storage medium, and the computer program includes program instructions, and when the program instructions are executed by a computer, the computer implements the steps of the Markdown text automatic conversion method according to any one of the above.

[0046] The Markdown text automatic conversion method, device, medium and program product provided by the embodiment of the application, the method comprises: firstly, using a python-docx engine to parse the Markdown text to be converted, to generate a basic Word document, the basic Word document comprising a cover, a text and a directory placeholder area; secondly, saving the basic Word document as a temporary docx file; thirdly, using a win32com engine to load the temporary docx file, identifying and releasing the directory placeholder area space, and inserting a real directory into the directory placeholder area space, and performing real-time refreshing on the association between the directory title and the page number, to obtain a converted document. The advantages of Python-docx and win32com are integrated, the automatic conversion from the Markdown text to the Word document with the automatically updated directory and the standard page number format is realized, and the document processing efficiency and quality are effectively improved. BRIEF DESCRIPTION OF DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only exemplary, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of the provided drawings.

[0048] Figure 1 The flowchart of the Markdown text automatic conversion method provided by the embodiment of the present application is shown in the figure.

[0049] Figure 2 The processing flow of the Markdown text automatic conversion method provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0050] In order to make the person skilled in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.

[0051] In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0052] Figure 1 The figure shows a flowchart of an automatic Markdown text conversion method according to an embodiment of the present invention.

[0053] like Figure 1 As shown, the Markdown text automatic conversion method according to an embodiment of the present invention may include steps S100, S200 and S300.

[0054] Combination Figure 2 In step S100, the Python-docx engine is used to parse the Markdown text to be converted and generate a basic Word document, which includes a cover, body text and table of contents placeholders.

[0055] Specifically, the above steps include:

[0056] An initial Word document is created by calling the Document() command. This blank initial Word document serves as the carrier for content generation, and the global style of the document can be customized through the doc.styles.font series of properties. Custom styles include body text styles and heading styles at all levels.

[0057] In the cover area of ​​the initial Word document, a standardized cover is generated by combining structured elements. The standardized cover includes a title area, an author area, and a date area. The title area uses the command add_heading(level=0) to set the title paragraph, while the author and date areas are set by calling the command doc.add_paragraph(). The font size, title and author information, and the vertical spacing of the date elements are also set for the standardized cover.

[0058] Use the `add_page_break()` command to insert a page break at the end of the cover page to ensure that the main text starts on a new page.

[0059] To reserve space for the table of contents generated by win32com and to avoid confusion between the main text and the table of contents, a placeholder area for the table of contents is created in the initial Word document. This placeholder area includes the table of contents heading paragraphs and placeholder paragraphs.

[0060] First, set a centered table of contents heading paragraph, then insert the text "Table of Contents" to clearly identify the table of contents area.

[0061] Insert "This section will be automatically generated by the program..." as a preset temporary placeholder in the above placeholder paragraph. This preset temporary placeholder will be used to replace the actual directory generated by win32com later.

[0062] The section divider is inserted in the directory placeholder area by using the instruction add_section(), so as to separate the directory placeholder area from the text area, thereby facilitating independent setting of the page header and footer.

[0063] According to the analysis result of the Markdown text to be converted, the Word text is generated in the initial Word document text area, specifically including:

[0064] Title analysis and level mapping: in the initial Word document text area, according to the number of preset symbols “#” in each title text in the Markdown text corresponding to the initial Word document, the instruction doc.add_heading(level=levelNum) is called to map each title text to each outline level of the initial Word document, and the title is generated in the initial Word document, for example: # corresponds to outline level 1, level=1, ## corresponds to outline level 2, level=2.

[0065] List analysis and conversion: according to the line head mark (- or *) of the list text in the Markdown text corresponding to the initial Word document, the unordered list item is identified, and the instruction add_paragraph(style=‘ListBullet’) is called according to the list item to generate the item symbol list in the initial Word document, and the list item text is applied to the style and set to the paragraph format.

[0066] Table analysis and structured generation: the Markdown table syntax (| header |) and filtered separator line (pure separator line containing - and |) of the table text in the Markdown text corresponding to the initial Word document are parsed, and the Word table is structured and generated in the initial Word document according to the analysis result, the table is created by the instruction add_table(), the table header cell text style is set, and subsequent table rows are added by the instruction table.add_row(), and the table style adopts “Table Grid” (grid lines are visible).

[0067] Normal paragraph processing: for the normal paragraph in the Markdown text corresponding to the initial Word document except the title, list and table, the corresponding normal paragraph text is generated by calling the instruction add_paragraph(), and the normal paragraph text is formatted according to the pre-defined style.

[0068] Then, in step S200, the basic Word document is saved as a temporary docx file.

[0069] Specifically, the above steps include:

[0070] The generated base Word document is saved as a temporary docx file by the instruction doc.save(self.temp_docx), and the temporary docx file includes complete outline structure (title level) and format information, and provides a data basis for subsequent table of contents generation.

[0071] The embodiment of the application constructs a document main body structure (including a cover, a text element) through a python-docx engine, and reserves a table of contents placeholder area, thereby providing a basis for subsequent win32com enhancement.

[0072] In step S300, the temporary docx file is loaded by using a win32com engine, a table of contents placeholder area is identified and released, a real table of contents is inserted into the table of contents placeholder area, the association between the table of contents title and the page number is refreshed in real time, and a converted document is obtained.

[0073] Specifically, the above steps include:

[0074] A COM object is created, and a Word application instance is initialized by calling win32.gencache.EnsureDispatch('Word.Application') through a pywin32 library.

[0075] The temporary docx file (self.temp_docx) generated by Python-docx is loaded by using a win32com engine calling instruction Documents.Open().

[0076] The document section list of the loaded temporary docx file is obtained by doc.Sections, the cover area corresponding to the first section and the table of contents placeholder area corresponding to the second section in the section list are set to have a footer LinkToPrevious=True and empty footer text (Range.Text=""), so that no page number is displayed, the text area corresponding to the third section and subsequent sections in the section list is set to have LinkToPrevious=False to independently control the page number, the main footer is positioned by Footers(wdHeaderFooterPrimary) and a page number field is inserted, and the page number format is configured. The embodiment of the application realizes the page number isolation of the cover, the table of contents and the text (the cover and the table of contents have no page number, and the text is numbered from the first page).

[0077] A dynamic table of contents based on a title style is generated by positioning the table of contents placeholder area reserved by Python-docx, and specifically includes:

[0078] Placeholder text recognition: Traverse the document paragraphs (doc.Paragraphs) of the loaded temporary docx file, find the preset temporary placeholder with the text "This place will be automatically generated by the program... " and locate the directory insertion position.

[0079] Placeholder text removal: Delete the preset temporary placeholder using the instruction para.Range.Delete() to release the directory generation space.

[0080] Directory generation parameter configuration: Insert the real directory into the placeholder area corresponding to the preset temporary placeholder through the instruction TablesOfContents.Add(), and set the core directory parameters such as range constraint, title level, and page format.

[0081] Instant directory update: Refresh the directory through the instruction toc.Update(), and refresh the association between the directory title and the page number in real time to ensure the accurate association between the title and the page number, so as to solve the problem of page number deviation caused by title position change in the document generation process.

[0082] Finally, release the resources, and save the file after inserting the real directory as the converted document.

[0083] The embodiment of the application utilizes the win32com engine to realize the automatic generation of the directory, the control of the page number and the optimization of the format by calling the COM interface of Microsoft Word, which is difficult to be completed by Python-docx, and completes the "enhanced processing" of the basic document.

[0084] In addition, the embodiment of the application also provides a Markdown text automatic conversion device, which comprises a processor and a memory.

[0085] In addition, the embodiment of the application also provides a computer readable storage medium, which stores a computer program.

[0086] In addition, the embodiment of the application also provides a computer program product, which comprises computer program instructions.

[0087] The Markdown text automatic conversion method, device, medium and program product provided by the application have the following advantages:

[0088] Dual-engine collaborative architecture: First time to deeply integrate python-docx and win32com components, forming a "basic construction + advanced enhancement" division and cooperation mode, through the collaborative work of python-docx and win32com components, realizing the full-process automation of Markdown text to Word document. Python-docx is responsible for the structured construction of static content (title, paragraph, table, etc.), and generates a basic document that meets the outline specification of Word; win32com is responsible for dynamic format enhancement (automatic generation and update of directory, page number rule customization), which makes up for the shortcomings of Python-docx in dynamic directory, field code processing, etc. by calling the native COM interface of Word. The two form a complete "analysis- construction-enhancement" pipeline through temporary document interaction.

[0089] Structured mapping algorithm from Markdown elements to Word objects: Through the combination of regular analysis and state machine, the "one-to-one" mapping between Markdown syntax and Word format is realized, ensuring that the converted document structure is clear and the format is standard, reducing the cost of manual typesetting.

[0090] Directory accurate generation mechanism based on placeholder area: The invention embodiment proposes a dynamic directory generation scheme of "directory placeholder area reservation + text matching positioning". Insert "directory title + placeholder text" in the Python-docx stage to clearly indicate the position of the directory in the document and avoid confusion with the main text. Subsequently, the placeholder text is accurately positioned and deleted by win32com to automatically generate a directory based on the outline level. This solves the problems of "difficulty in aligning the directory with the main text structure" and "weak dynamic association of page numbers" in Markdown conversion, ensuring the automatic synchronization of the directory with the title and page numbers without manual adjustment.

[0091] Cross-platform compatibility design: python-docx is responsible for cross-platform content generation, and win32com only enhances the directory function in the Windows environment to avoid the platform limitations of pure COM solutions.

[0092] In an embodiment of the present application, the processor can be an integrated circuit chip, with the processing capability that the signal is processed. The processor can be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component. The methods, steps and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed by the processor. The general purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the methods disclosed in the embodiments of the present application can be directly embodied as the hardware code executed by the processor, or a combination of hardware and software modules in the processor. The software module can reside in the random memory, the flash memory, the read-only memory, the programmable read-only memory, the electrically programmable read-only memory, the register, or other forms of the storage medium in the art. The processor reads information in the storage medium and combines the hardware to complete the steps of the above methods. The storage medium can be the memory, for example, can be the volatile memory or the non-volatile memory, or can include both volatile and non-volatile memory. The non-volatile memory can be the read-only memory (ROM), the programmable read-only memory (PROM), the erasable programmable read-only memory (EPROM), the electrically erasable programmable read-only memory (EEPROM) or the flash memory. The volatile memory can be the random access memory (RAM), which is used as the external cache. By way of example, but not limitation, many forms of RAM can be used, such as the static random access memory (SRAM), the dynamic random access memory (DRAM), the synchronous dynamic random access memory (SDRAM), the double data rate synchronous dynamic random access memory (DDR SDRAM), the enhanced synchronous dynamic random access memory (ESDRAM), the synchlink dynamic random access memory (SLDRAM) and the direct Rambus dynamic random access memory (DRRAM).The storage media described in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable type of memory. It will be appreciated by those skilled in the art that the functions described in the above-mentioned one or more examples can be implemented in combination with hardware and software. When the software is applied, the corresponding functions can be stored in a computer readable medium or transmitted as one or more instructions or codes on the computer readable medium. The computer readable medium includes a computer storage medium and a communication medium, wherein the communication medium includes any medium that facilitates the transfer of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general or special purpose computer. Although the present application has been described in detail above with general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present application on the basis of the present application. Therefore, these modifications or improvements made without departing from the spirit of the present application are within the scope of the present application.

[0093] The above description is only the preferred embodiment of the present application, and does not limit the present application in any form. Those skilled in the art can make some simple modifications, equivalent changes or modifications to the above disclosed technical content, which are within the scope of the present application.

Claims

1. A Markdown text automatic conversion method, characterized in that, The method includes: The Python-docx engine is used to parse the Markdown text to be converted and generate a basic Word document, which includes a cover, body text, and table of contents placeholders. Save the basic Word document as a temporary docx file; The temporary docx file is loaded using the win32com engine, the table of contents placeholder space is identified and released, and the actual table of contents is inserted into the placeholder space. The association between the table of contents titles and page numbers is refreshed in real time to obtain the converted document.

2. The method of claim 1, wherein, The Python-docx engine is used to parse the Markdown text to be converted and generate a basic Word document, including: An initial Word document with custom styles is created by calling the Document() command. The custom styles include body text styles and heading styles at all levels. In the cover area of ​​the initial Word document, a standardized cover is generated by combining structured elements. The standardized cover includes a title area, an author area, and a date area. Use the `add_page_break()` command to insert a page break at the end of the cover page; Create a table of contents placeholder area for the initial Word document, the table of contents placeholder area including table of contents heading paragraphs and placeholder paragraphs; Insert a preset temporary placeholder into the placeholder paragraph; the preset temporary placeholder is to be replaced by the actual directory. Use the add_section() command to insert a section break in the table of contents placeholder area, thus separating the table of contents placeholder area from the main text area; Based on the parsing results of the Markdown text to be converted, Word text is generated in the text area of ​​the initial Word document to obtain the basic Word document.

3. The method of claim 2, wherein, Based on the parsing results of the Markdown text to be converted, Word text is generated in the initial Word document text area, including: In the body area of ​​the initial Word document, based on the number of preset symbols in each heading text in the Markdown text corresponding to the initial Word document, each heading text is mapped to the major outline levels of the initial Word document, and a heading is generated in the initial Word document; Identify unordered list items based on the line beginning markers of the list text in the Markdown text corresponding to the initial Word document, and generate a bulleted list in the initial Word document by calling the instruction add_paragraph(style='List Bullet') based on the unordered list items; The Markdown table syntax of the table text in the Markdown text corresponding to the initial Word document is parsed, and a Word table is generated in the initial Word document in a structured manner based on the parsing result. For the normal paragraph in the Markdown text corresponding to the initial Word document, except for the title, list and table, the corresponding normal paragraph text is generated by calling the instruction add_paragraph(), and the normal paragraph text is formatted according to the predefined style.

4. The method of claim 2, wherein, The standardized cover is generated by combining structured elements, including: The title paragraph is set in the title area by using the instruction add_heading(level=0), and the author area and the date area are set by calling the instruction doc.add_paragraph(). The page break symbol is inserted at the end of the standardized cover by using the instruction add_page_break() to set the page.

5. The method of claim 1, wherein, The basic Word document is saved as a temporary docx file, including: The basic Word document is saved as a temporary docx file by using the instruction doc.save(self.temp_docx), and the temporary docx file includes complete outline structure and format information.

6. The method of claim 1, wherein, The method further includes: The section list of the loaded temporary docx file is obtained by doc.Sections. The footer text of the cover area and the table of contents placeholder area corresponding to the section list is emptied. The main footer is located by Footers(wdHeaderFooterPrimary) and the page number field is inserted, and the page number format is configured, to independently control the page number of the text area corresponding to the section list.

7. The method of claim 2, wherein, The space of the table of contents placeholder area is identified and released, and the real table of contents is inserted in the table of contents placeholder area, and the association between the table of contents title and the page number is refreshed in real time to obtain the converted document, including: The preset temporary placeholder in the document paragraph of the loaded temporary docx file is found by iteration; The preset temporary placeholder is deleted by using the instruction para.Range.Delete(); The real table of contents is inserted in the placeholder area corresponding to the preset temporary placeholder by using the instruction TablesOfContents.Add(), and the table of contents parameters are set; The association between the table of contents title and the page number is refreshed in real time by using the instruction toc.Update(); The file after inserting the real table of contents is saved as the converted document.

8. A Markdown text automatic conversion device characterized by comprising: The device includes a processor and a memory; The memory is used to store one or more program instructions; The processor is used to run one or more program instructions to execute the steps of the Markdown text automatic conversion method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer program is stored on the computer readable storage medium, and the computer program is executed by the processor to implement the steps of the Markdown text automatic conversion method according to any one of claims 1 to 7.

10. A computer program product, characterised in that, The computer program product includes computer program instructions, which are executed by the processor to implement the steps of the Markdown text automatic conversion method according to any one of claims 1 to 7.