A page code preview method, device and storage medium thereof

By scanning and extracting predetermined character segments of the page code and embedding them into the preview text, the problem of not being able to preview page rendering during the code writing process is solved, real-time preview is achieved and development efficiency is improved.

CN112817588BActive Publication Date: 2025-03-18BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201911119592.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-11-15
Publication Date
2025-03-18
Estimated Expiration
2039-11-15

AI Technical Summary

Technical Problem

During the code writing process, the page design effect corresponding to the code cannot be visually seen, resulting in developers being unable to preview page rendering in real time.

Method used

By scanning the page code, a predetermined character segment that conforms to the predetermined character selection principle is extracted, and embedded it in text that can perform preview operations, and perform a preview operation to achieve page rendering preview.

Benefits of technology

Real-time preview of page rendering during code writing is realized, which improves development efficiency and solves the problem of not being able to preview the page design effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112817588B_ABST
    Figure CN112817588B_ABST
Patent Text Reader

Abstract

The present invention discloses a preview method, device and storage medium of a page code, the method comprising: scanning a page code to obtain a predetermined character segment that meets a predetermined character selection principle, embedding the predetermined character segment into a text that can perform a preview operation, and performing a preview operation on the text embedded with the predetermined character segment. The character segment in the page code is converted into the text that can perform a preview operation according to the characteristics of the character segment, and then a preview operation is performed on the text to realize the rendering preview of the page code, thereby solving the technical problem in the prior art that a page rendering preview cannot be performed during the code writing process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to a page code preview method, device and storage medium thereof. Background Art

[0002] Currently, in many page browsing development applications, page rendering and previewing require calling external systems or components within the system, and page rendering and previewing cannot be performed during code development. For example, in the Flutter development process, the page layout adopts the Widget concept, and page rendering requires the use of system-provided Widgets or custom Widgets. During the code compilation process, the page UI code cannot be directly previewed, so developers will never know the page effect of the code.

[0003] Therefore, the inventors have discovered that there are at least the following problems in the prior art: a technical problem that the page design effect corresponding to the code cannot be intuitively seen during the code writing process. Summary of the invention

[0004] The present application provides a page code preview method, which aims to preview the page code by utilizing the character segment characteristics of the page code, thereby solving the technical problem in the prior art that page rendering preview cannot be performed in a code writing environment.

[0005] The method includes:

[0006] Scan the page code to obtain a predetermined character segment that meets the predetermined character selection principle;

[0007] embedding the predetermined character segment into a text capable of executing a preview operation;

[0008] A preview operation is performed on the text embedded with the predetermined character segment.

[0009] Optionally, before the step of scanning the page code to obtain a predetermined character segment that complies with a predetermined character selection principle, the method further includes:

[0010] Reading a file code, wherein the file code is a code that is all or part of the page code;

[0011] Scanning the file code line by line to obtain a range identification character segment of the page code, wherein the range identification character segment is a character segment used to identify the range of the page code in the file code;

[0012] The page code in the file code is obtained according to the range identification character segment.

[0013] Optionally, the scanning of the page code to obtain a predetermined character segment that meets the predetermined character selection principle includes:

[0014] Scanning the page code;

[0015] Acquire a designated character segment having an associated character segment, wherein the designated character segment is a code character segment that complies with a predetermined code rule;

[0016] The associated character segment associated with the designated character segment is used as the predetermined character segment.

[0017] Optionally, the predetermined code rule is that the designated character segment has a positioning identification character segment and a keyword character segment, as well as the associated character segment, wherein the positioning identification character segment is used to locate the position of the keyword character segment in the designated character segment, and the keyword character segment is used to indicate the associated character segment in the designated character segment.

[0018] Optionally, after the step of obtaining a designated character segment having an associated character segment, wherein the designated character segment is a code character segment conforming to a predetermined code rule, the method further comprises:

[0019] Determining whether the keyword character segment belongs to a predetermined keyword, wherein the predetermined keyword is a preset character segment;

[0020] If the keyword character segment does not belong to the predetermined keyword, rescanning starts from the beginning of the file code until the range identification character segment is scanned and the page code is obtained;

[0021] Return to the step of scanning the page code.

[0022] Optionally, after the step of obtaining a designated character segment having an associated character segment, wherein the designated character segment is a code character segment conforming to a predetermined code rule, the method further comprises:

[0023] determining whether the keyword character segment belongs to a predetermined keyword, wherein the predetermined keyword is a preset character segment,

[0024] If the keyword character segment belongs to the predetermined keyword, the associated character segment indicated by the keyword character segment is obtained.

[0025] Optionally, after the step of obtaining a designated character segment having an associated character segment, wherein the designated character segment is a code character segment conforming to a predetermined code rule, the method further comprises:

[0026] Parsing the attributes and / or format of the keyword segment definition, wherein the keyword segment is also used to define the attributes and / or format of the associated segment;

[0027] Converting the attributes and / or format into the text may be used to define a statement with the same attributes and / or format embedded in the text, so that the associated character segment embedded in the text is previewed with the same attributes and / or format.

[0028] The present application also provides a page code preview device, the device comprising:

[0029] A scanning and selecting module is used to scan the page code to obtain a predetermined character segment that meets the predetermined character selection principle;

[0030] An embedding module, used for embedding the predetermined character segment into the text capable of executing the preview operation;

[0031] The preview module is used to perform a preview operation on the text embedded with the predetermined character segment.

[0032] Optionally, the device comprises:

[0033] A reading module, used for reading a file code, wherein the file code is a code that is all or part of the page code;

[0034] A scanning and identifying module, used for scanning the file code line by line to obtain a range identifying character segment of the page code, wherein the range identifying character segment is a character segment used to identify the range of the page code in the file code;

[0035] A code acquisition module is used to acquire the page code in the file code according to the range recognition character segment.

[0036] Optionally, the device further comprises:

[0037] The scanning and identifying module is used to scan the page code to obtain a designated character segment with an associated character segment, wherein the designated character segment is a code character segment that complies with a predetermined code rule; and to use the associated character segment associated with the designated character segment as the predetermined character segment.

[0038] Optionally, the device further comprises:

[0039] A judging module, used for judging whether the keyword character segment belongs to a predetermined keyword, wherein the predetermined keyword is a preset character segment;

[0040] If the keyword character segment does not belong to the predetermined keyword, rescanning starts from the beginning of the file code until the range identification character segment is scanned and the page code is obtained;

[0041] The return module is used for the step of scanning the page code.

[0042] Optionally, the device further comprises:

[0043] The judging module is used to judge whether the keyword character segment belongs to a predetermined keyword, wherein the predetermined keyword is a preset character segment.

[0044] If the keyword character segment belongs to the predetermined keyword, the associated character segment indicated by the keyword character segment is obtained.

[0045] Optionally, the device further comprises:

[0046] A parsing module, used for parsing the attributes and / or format of the keyword character segment definition, wherein the keyword character segment is also used for defining the attributes and / or format of the associated character segment;

[0047] A conversion module, used for converting properties and / or formats into the text, can be used to define a statement with the same properties and / or formats to be embedded in the text, so that the associated character segment embedded in the text can be previewed with the same properties and / or formats.

[0048] The present application also provides a page code preview device, the device comprising: a processor and a memory;

[0049] The memory stores an application program executable by the processor, which is used to enable the processor to execute the steps of the page code preview method.

[0050] The present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the page code preview method are implemented.

[0051] As can be seen above, based on the above embodiment, the character segment in the page code is converted into the text that can be previewed through the characteristics of the character segment in the page code, and then the preview operation is performed on the text to realize the rendering preview of the page code, which solves the technical problem in the prior art that the page rendering preview cannot be performed during the code writing process. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0053] Figure 1 This is a section of page code in the file code under the Widget environment of the present invention

[0054] Figure 2 A schematic diagram of a flow chart of a page code preview method of the present invention;

[0055] Figure 3 A schematic diagram of a flow chart of a page code preview method of the present invention;

[0056] Figure 4 A schematic diagram of a flow chart of a page code preview method of the present invention;

[0057] Figure 5 FIG. 4 is a schematic diagram of the structure of the preview device of the page code of the present invention. DETAILED DESCRIPTION

[0058] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0059] In many page code editing environments, you cannot directly see the page rendering effect corresponding to the page code. For example, in the Flutter development process, the page adopts the Widget concept, so it is impossible to preview the page code in real time.

[0060] In the present application, the inventors found that no matter what kind of page code, its code language has a specific grammatical structure, which can be used to extract the necessary information for displaying the preview, and then reorganize the necessary information into an executable preview page code for preview. Figure 1 It is a section of page code in the file code under the Widget environment of the present invention, such as Figure 1 As shown, we will explain this code below. It should be pointed out that Figure 1 The page codes in the figure are only for better explaining the embodiments of the present application and are not specific limitations of the present application.

[0061] Figure 2 FIG. 1 is a flow chart of a preview method of a page code of the present invention. Figure 1 and Figure 2 As shown, in one embodiment, the present application provides a method for previewing page code, the method comprising:

[0062] S101, scanning the page code to obtain a predetermined character segment that meets the predetermined character selection principle;

[0063] In this step, the page code is scanned. The scanning here can be understood as line-by-line scanning. When the predetermined character segment is found, it is selected. The predetermined character selection principle can be understood as a predetermined character segment. The same character segment as the character segment here is selected from the page code, and this character segment can be understood as the predetermined character segment. Of course, a rule can also be set, and the character segment that meets the rule is positioned as the predetermined character segment. For example, newXXX, XXX here can be replaced with any character, as long as it meets the position space after the character new, and then the character segment with other character formats can be defined as the predetermined character segment, or the XXX content that meets this format can be defined as the predetermined character segment. In this step, we can extract the character content in the page rendering in this way for use in subsequent steps.

[0064] S102, embedding the predetermined character segment into the text on which the preview operation can be performed;

[0065] In this step, the predetermined character segment is embedded in the text that can perform the preview operation. We can understand that the text mentioned here is HTML text. The embedding method can be adopted Embedding method, such as embedding the predetermined character segment XXX into ,Right now . That is, it is in a text format that can be previewed by executing.

[0066] S103, performing a preview operation on the text embedded with the predetermined character segment.

[0067] In this step, a preview operation is performed on the text embedded with the predetermined character segment. By performing the preview operation, you can preview the content of XXX in the form of a page.

[0068] In this embodiment, a preview method for page code is provided, which scans the predetermined character segment in the page code that meets the predetermined character selection principle, embeds the predetermined character segment into the text that can perform the preview operation, and performs the preview operation on the text embedded with the predetermined character segment. The above method can preview the page code that cannot be previewed during the programming process, so that the R&D personnel can further develop and modify it, which greatly improves the R&D efficiency.

[0069] Before the step of scanning the page code to obtain a predetermined character segment that meets the predetermined character selection principle, the method may further include performing scanning of the page code through a predetermined operation of the user;

[0070] Its significance lies in that during the operation, a preview button of a page can be designed at the beginning, and subsequent operations on the page code can be executed after the user clicks the preview button.

[0071] Figure 3 FIG. 1 is a flow chart of a preview method of a page code of the present invention. Figure 3 As shown, in one embodiment, before the step of scanning the page code to obtain a predetermined character segment that meets the predetermined character selection principle, the method further includes:

[0072] S201, reading a file code, wherein the file code is a code that is all or part of the page code;

[0073] In this step, a specific step of reading the file code is provided. The page code may be the entire code or a part of it, so the page code needs to be separated from the file code. The file code here can be understood as the entire code in the file.

[0074] S202, scanning the file code line by line to obtain a range identification character segment of the page code, wherein the range identification character segment is a character segment used to identify the range of the page code in the file code;

[0075] In this step, a specific implementation method for obtaining the page code from the file code is provided. When programming the page code, a declaration is made at the beginning of the program. The declaration can be represented by a character segment, which is the range identification character segment. For example, Widget Build in the Widget programming environment can be understood as the range identification character segment. When scanning the file code line by line, if the range identification character segment of WidgetBuild is identified, it can be indicated that the subsequent code is the page code. In addition, it is also necessary to determine in which environment the editing is performed through the method here.

[0076] S203, obtaining the page code in the file code according to the range recognition character segment.

[0077] In this step, a specific implementation method for separating the page code from the file code is provided. In the application, it is not necessary to separate the page code from the file code, but to determine a range in the file code to simplify the subsequent processing process and clarify the current application environment for writing the page code.

[0078] In this embodiment, a specific implementation method for stripping the page code from the file code is provided, the file code is scanned line by line to obtain the range identification character segment of the page code, wherein the range identification character segment is a character segment used to identify the range of the page code in the file code; the page code in the file code is obtained according to the range identification character segment. According to the above method, the position of the page code in the file code can be locked, and subsequent steps, such as selecting the predetermined character segment, can be performed only on the page code, which simplifies the amount of calculation.

[0079] Figure 4 FIG. 1 is a flow chart of a preview method of a page code of the present invention. Figure 4 As shown, in one embodiment, the scanning of the page code to obtain a predetermined character segment that meets the predetermined character selection principle includes:

[0080] S301, scanning the page code;

[0081] In this step, the page code is scanned.

[0082] S302, obtaining a designated character segment having an associated character segment, wherein the designated character segment is a code character segment that complies with a predetermined code rule;

[0083] In this step, the associated character segment in the specified character segment is obtained. In the process of page code editing, the edited code contains the associated character segment. We still take the page code in the Widget environment as an example, such as the character segment of the code new MaterialApp(XXX). New MaterialApp(XXX) should be understood as a whole, that is, the specified character segment. The predetermined code rule can be defined as the first word is new, and then there is a bracket after the space. All the characters in the page code that meet the above rules are recorded as the specified character segments that meet the predetermined code rules. XXX can be understood as the associated character segment. In the Widget environment, the content of XXX is actually the specific content displayed on the page.

[0084] S303: Use the associated character segment associated with the designated character segment as the predetermined character segment.

[0085] In this step, a specific implementation method of using the associated character segment as the predetermined character segment is provided, and XXX is embedded in the previewable text after being used as the predetermined character segment. .right Executing the preview operation can display the preview of XXX in the form of page rendering.

[0086] In this embodiment, the page code is scanned; a designated character segment with an associated character segment is obtained, wherein the designated character segment is a code character segment that conforms to a predetermined code rule; and the associated character segment associated with the designated character segment is used as the predetermined character segment. The associated character segment in the designated character segment is stripped out and embedded into the text as the predetermined character segment, thereby achieving a preview. In other words, the content that needs to be rendered and displayed on the page, i.e., the associated character segment, can be stripped out and displayed through the specific code structure of the designated character segment.

[0087] In one embodiment, the predetermined code rule is that the designated character segment has a positioning identification character segment and a keyword character segment, as well as the associated character segment, wherein the positioning identification character segment is used to locate the position of the keyword character segment in the designated character segment, and the keyword character segment is used to indicate the associated character segment in the designated character segment.

[0088] In this embodiment, a specific embodiment of the predetermined code rule is provided, and the predetermined code rule defines that the specified character segment includes the positioning identification character segment and the keyword character segment, as well as the associated character segment. We still take new MaterialApp (XXX) as an example. The new in the statement can be connected to the positioning identification character segment, which itself serves as a grammatical statement in the page code. However, in the present invention, we understand the character segment corresponding to the statement as the positioning coordinates of the specified character segment in the page code. In other words, when the new character segment is scanned, it can be known that there is a specified character segment here in the page code, and the following character segments are the keyword character segment and the keyword character segment. The positioning identification character segment can not only locate the position of the specified character segment in the page code, but also define the positional relationship with the keyword character segment and the associated character segment, as long as the specified character segment follows a fixed character segment arrangement order or arrangement rule, such as defining a word and bracket after new in new MaterialApp (XXX) as the keyword character segment, that is, MaterialApp (), and the content XXX in the bracket is the associated character segment.

[0089] In one embodiment, after the step of obtaining a designated character segment having an associated character segment, wherein the designated character segment is a code character segment that complies with a predetermined code rule, the method further comprises:

[0090] Determining whether the keyword character segment belongs to a predetermined keyword, wherein the predetermined keyword is a preset character segment;

[0091] If the keyword character segment does not belong to the predetermined keyword, rescanning starts from the beginning of the file code until the range identification character segment is scanned and the page code is obtained;

[0092] Return to the step of scanning the page code.

[0093] In this embodiment, a specific implementation method for verifying whether the current scanning area belongs to the page code in the file code is provided. If new is scanned line by line, the keyword character segment is called to determine whether the keyword character segment belongs to the predetermined keyword. The predetermined keyword is some artificially preset grammatical character segments. For example, in the Widget environment, the predetermined keywords include MateriaLApp, Scaffold, AppBar, Text, and Center, etc. Of course, the page editing environment different from the Widget may have different predetermined keywords. When new is scanned during the scanning process, but the subsequent character segment is not the predetermined keyword, the character segment is not the keyword character segment, and the file code location is not the Widget environment, and does not meet the application conditions of the Widget. At this time, return to the step of scanning the page code and re-search for the range identification character segment, that is, the Widget Build in the Widget environment. In addition, only by determining the Widget environment can we determine whether fields such as MaterialApp, Scaffold, AppBar, Text, and Center are fields corresponding to the predetermined keywords. If this application wants to be implemented in other environments, then the predetermined keywords should be predetermined fields that conform to the syntax of the environment in the corresponding environment. If it needs to be implemented in multiple environments, then the different predetermined keywords in different environments can be classified, and then the scope recognition character segment recognition language programming environment such as Widget Build can be found, and finally the subsequent operations can be performed to realize previews in multiple environments.

[0094] In one embodiment, after the step of obtaining a designated character segment having an associated character segment, wherein the designated character segment is a code character segment that complies with a predetermined code rule, the method further comprises:

[0095] determining whether the keyword character segment belongs to a predetermined keyword, wherein the predetermined keyword is a preset character segment,

[0096] If the keyword character segment belongs to the predetermined keyword, the associated character segment indicated by the keyword character segment is obtained.

[0097] Similarly in this embodiment, if the keyword character segment belongs to the predetermined keyword, then the page code is the character segment in the Widget environment, so the keyword character segment can be understood as the associated character segment it indicates is the content that needs to be displayed on the page.

[0098] In one embodiment, after the step of obtaining a designated character segment having an associated character segment, wherein the designated character segment is a code character segment that complies with a predetermined code rule, the method further comprises:

[0099] Parsing the attributes and / or format of the keyword segment definition, wherein the keyword segment is also used to define the attributes and / or format of the associated segment;

[0100] Converting the attributes and / or format into the text may be used to define a statement with the same attributes and / or format embedded in the text, so that the associated character segment embedded in the text is previewed with the same attributes and / or format.

[0101] In this embodiment, the keyword character segment in the Widget environment is also used to define the attributes and / or format of the associated character segment when generating a rendered page. Therefore, the corresponding same attributes and / or format statements in the text can be found by parsing the keyword character segment, and the associated character segment can be previewed with the same attributes and / or format.

[0102] Figure 5 FIG. 1 is a schematic diagram of the structure of the preview device of the page code of the present invention. Figure 5 As shown, in one embodiment, the present application further provides a page code preview device, the device comprising:

[0103] The scanning and selecting module 101 is used to scan the page code to obtain a predetermined character segment that meets the predetermined character selection principle;

[0104] An embedding module 102, used for embedding the predetermined character segment into a text capable of performing a preview operation;

[0105] The preview module 103 is used to perform a preview operation on the text embedded with the predetermined character segment.

[0106] In one embodiment, the apparatus comprises:

[0107] A reading module 104, configured to read a file code, wherein the file code is a code that is all or part of the page code;

[0108] A scanning and identifying module 105 is used to scan the file code line by line to obtain a range identifying character segment of the page code, wherein the range identifying character segment is a character segment used to identify the range of the page code in the file code;

[0109] The code acquisition module 106 is used to acquire the page code in the file code according to the range recognition character segment.

[0110] In one embodiment, the device further comprises:

[0111] The scanning and identifying module 105 is used to scan the page code to obtain a designated character segment with an associated character segment, wherein the designated character segment is a code character segment that complies with a predetermined code rule; and to use the associated character segment associated with the designated character segment as the predetermined character segment.

[0112] In one embodiment, the device further comprises:

[0113] A judging module 107, configured to judge whether the keyword character segment belongs to a predetermined keyword, wherein the predetermined keyword is a preset character segment;

[0114] If the keyword character segment does not belong to the predetermined keyword, rescanning starts from the beginning of the file code until the range identification character segment is scanned and the page code is obtained;

[0115] Return module 108 is used for the step of scanning the page code.

[0116] In one embodiment, the device further comprises:

[0117] The judging module 107 is used to judge whether the keyword character segment belongs to a predetermined keyword, wherein the predetermined keyword is a preset character segment.

[0118] If the keyword character segment belongs to the predetermined keyword, the associated character segment indicated by the keyword character segment is obtained.

[0119] In one embodiment, the device further comprises:

[0120] A parsing module 109, configured to parse the attributes and / or format of the keyword segment definition, wherein the keyword segment is also used to define the attributes and / or format of the associated segment;

[0121] The conversion module 110 is used to convert the attributes and / or formats into the text and can be used to define a statement with the same attributes and / or formats to be embedded in the text, so that the associated character segment embedded in the text can be previewed with the same attributes and / or formats.

[0122] In one embodiment, the present application also provides a page code preview device, the device comprising: a processor and a memory;

[0123] The memory stores an application program executable by the processor, which is used to enable the processor to execute the steps of the page code preview method.

[0124] In one embodiment, the present application further provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the steps of the page code preview method are implemented.

[0125] In practical applications, the computer-readable medium may be included in the device / apparatus / system described in the above embodiments, or may exist independently without being assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the data table partitioning device described above implements the data table partitioning method.

[0126] According to the embodiments disclosed in the present application, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof, but it is not used to limit the scope of protection of the present application. In the embodiments disclosed in the present application, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device.

[0127] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A page code preview method, characterized in that: The method includes: Scan the page code to obtain a predetermined character segment that meets the predetermined character selection principle; wherein, scanning the page code to obtain the predetermined character segment that meets the predetermined character selection principle includes: scanning the page code; obtaining a designated character segment with an associated character segment, wherein the designated character segment is a code character segment that meets the predetermined code rule; and using the associated character segment associated with the designated character segment as the predetermined character segment; embedding the predetermined character segment into a text capable of executing a preview operation; A preview operation is performed on the text embedded with the predetermined character segment.

2. The page code preview method according to claim 1, characterized in that: Before the step of scanning the page code to obtain a predetermined character segment that meets the predetermined character selection principle, the method further includes: Reading a file code, wherein the file code is a code that is all or part of the page code; Scanning the file code line by line to obtain a range identification character segment of the page code, wherein the range identification character segment is a character segment used to identify the range of the page code in the file code; The page code in the file code is obtained according to the range identification character segment.

3. The page code preview method according to claim 2, characterized in that: The predetermined code rule is that the designated character segment has a positioning identification character segment and a keyword character segment, as well as the associated character segment, wherein the positioning identification character segment is used to locate the position of the keyword character segment in the designated character segment, and the keyword character segment is used to indicate the associated character segment in the designated character segment.

4. The page code preview method according to claim 3, characterized in that: After the step of obtaining a designated character segment with an associated character segment, wherein the designated character segment is a code character segment that complies with a predetermined code rule, the method further comprises: determining whether the keyword character segment belongs to a predetermined keyword, wherein the predetermined keyword is a preset character segment; If the keyword character segment does not belong to the predetermined keyword, rescanning starts from the beginning of the file code until the range identification character segment is scanned and the page code is obtained; Return to the step of scanning the page code.

5. The page code preview method according to claim 3, characterized in that: After the step of obtaining a designated character segment with an associated character segment, wherein the designated character segment is a code character segment that complies with a predetermined code rule, the method further comprises: determining whether the keyword character segment belongs to a predetermined keyword, wherein the predetermined keyword is a preset character segment, If the keyword character segment belongs to the predetermined keyword, the associated character segment indicated by the keyword character segment is obtained.

6. The page code preview method according to claim 3, characterized in that: After the step of obtaining a designated character segment having an associated character segment, wherein the designated character segment is a code character segment conforming to a predetermined code rule, the method further comprises: Parsing the attributes and / or format of the keyword segment definition, wherein the keyword segment is also used to define the attributes and / or format of the associated segment; Converting the attributes and / or format into the text may be used to define a statement with the same attributes and / or format embedded in the text, so that the associated character segment embedded in the text is previewed with the same attributes and / or format.

7. A page code preview device, characterized in that: The device includes: A scanning and selecting module, used for scanning the page code to obtain a predetermined character segment that meets the predetermined character selection principle; wherein, scanning the page code to obtain the predetermined character segment that meets the predetermined character selection principle includes: scanning the page code; obtaining a designated character segment with an associated character segment, wherein the designated character segment is a code character segment that meets the predetermined code rule; and using the associated character segment associated with the designated character segment as the predetermined character segment; An embedding module, used for embedding the predetermined character segment into the text capable of executing the preview operation; The preview module is used to perform a preview operation on the text embedded with the predetermined character segment.

8. A page code preview device, characterized in that: The device comprises: a processor and a memory; The memory stores an application program executable by the processor, which is used to enable the processor to execute the steps of the page code preview method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the page code preview method described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Webpage processing method and device and equipment

    CN107798001A