Method, device and electronic device for implementing annotation function in rich text editor

By identifying and processing annotation behavior in a rich text editor, performing highlighting and storing annotation content, and rendering it, the problem that existing rich text editors cannot support content annotation is solved, and the user experience is improved.

CN118886403BActive Publication Date: 2025-05-06CAPITAL CLOUD TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410930264.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2025-05-06
Estimated Expiration
2044-07-11

AI Technical Summary

Technical Problem

The existing rich text editor has poor expansion capabilities and cannot support content annotation, resulting in users being unable to effectively annotate, distinguish or highlight text during the editing process, affecting the user experience.

Method used

By obtaining the input signal generated in the rich text editor, the behavior type in the input signal is determined. If it is an annotation type, highlight the marked content in the editing area based on the preset data rules, store the annotation content copy, and render the content based on the preset data format and the rich text editing script to fill it to the highlight position.

Benefits of technology

It realizes effective annotation of text by users, facilitates subsequent maintenance and use, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118886403B_ABST
    Figure CN118886403B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and electronic device for realizing the annotation function in a rich text editor, and relates to the technical field of text editing. The method comprises: obtaining an input signal generated in the rich text editor, and determining the behavior type in the input signal; if the behavior type is an annotation type, highlighting the annotated content in the editing area in sequence based on a pre-set data rule to obtain a highlighted position; using the pre-set annotation content copy as the rich text content corresponding to the highlighted position, and storing the rich text content in a pre-set data container; rendering the rich text content in the data container based on a pre-set data format and a pre-set rich text editing script; and filling the rendered rich text content into the annotation position corresponding to the highlighted position. In this way, the user can effectively annotate the text, which is convenient for the user's subsequent maintenance and use, and improves the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of text editing, and in particular to a method, device and electronic device for implementing a marking function in a rich text editor. Background Art

[0002] Rich text is a document that is rendered and calculated by a rich text editor and then presented to the user. Currently, the most widely used rich text editors mostly use the HTML (Hypertext Markup Language) data format. This type of rich text editor can be embedded in the browser, supporting users to write, format and publish content on the web page.

[0003] However, such rich text editors usually have poor expansion capabilities and support limited rich text types. For example, the rich text editor does not support content annotation. In this case, users can only edit content separately, which makes it impossible for users to effectively annotate, distinguish or highlight text during editing, which brings inconvenience to users' subsequent maintenance and use, and reduces user experience. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a method, device and electronic device for implementing the annotation function in a rich text editor, so that users can effectively annotate text, facilitate subsequent maintenance and use by users, and improve user experience.

[0005] In the first aspect, an embodiment of the present invention provides an implementation of a marking function in a rich text editor, which obtains an input signal generated in the rich text editor and determines a behavior type in the input signal; if the behavior type is a marking type, the marked content in the editing area is highlighted in turn based on a preset data rule to obtain a highlighted position; the editing area is included in an interactive page of the rich text editor; a preset marking content copy is used as the rich text content corresponding to the highlighted position, and the rich text content is stored in a preset data container; the rich text content in the data container is rendered based on a preset data format and a preset rich text editing script; and the rendered rich text content is filled into the marking position corresponding to the highlighted position.

[0006] In a preferred embodiment of the present invention, the above-mentioned determination of the behavior type in the input signal includes: determining the generation mode of the input signal; if the generation mode is a menu mode, obtaining the behavior type corresponding to each menu mode based on a preset menu and behavior type mapping table; if the generation mode is a secondary menu mode of an instruction, determining that the behavior type is a special input behavior type.

[0007] In a preferred embodiment of the present invention, the above method further includes: if the behavior type is a special input behavior type, determining a special input corresponding to the special input behavior type; and updating the rich text content in the data container based on the special input.

[0008] In a preferred embodiment of the present invention, the above-mentioned rendering of rich text content in the data container based on a preset data format and a preset rich text editing script includes: if the data format is a annotation format, obtaining the annotated content, the highlighted position and the annotation content text; based on the rich text editing script, converting the rich text content in the data container into an operation corresponding to the annotation type.

[0009] In a preferred embodiment of the present invention, before rendering the rich text content in the data container based on the preset data format and the preset rich text editing script, the method also includes: obtaining and activating the rich text editing script preloaded in the rich text editor corresponding to the behavior type.

[0010] In a preferred embodiment of the present invention, the above-mentioned acquisition and activation of the rich text editing script preloaded in the rich text editor corresponding to the behavior type includes: acquiring the rich text attribute corresponding to the behavior type; registering the rich text attribute in the rich text editor, and associating the rich text editing script with the response based on the rich text attribute.

[0011] In a preferred embodiment of the present invention, the above-mentioned storing the rich text content in a pre-set data container includes: converting the data format of the rich text content into a data format; and storing the rich text content after the data format conversion into the corresponding data container.

[0012] In the second aspect, an embodiment of the present invention also provides a device for implementing the annotation function in a rich text editor, the device comprising: a behavior type determination module, used to obtain an input signal generated in the rich text editor, and determine the behavior type in the input signal; a highlight execution module, used to highlight the annotated content in the editing area in sequence based on pre-set data rules to obtain a highlighted position if the behavior type is an annotation type; the editing area is included in an interactive page of the rich text editor; a rich text content storage module, used to use a pre-set annotation content copy as the rich text content corresponding to the highlighted position, and store the rich text content in a pre-set data container; a rich text content rendering module, used to render the rich text content in the data container based on a pre-set data format and a pre-set rich text editing script; and a annotation module, used to fill the rendered rich text content into the annotation position corresponding to the highlighted position.

[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the annotation function implementation method in the rich text editor of the first aspect above.

[0014] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the annotation function implementation method in the rich text editor of the first aspect above.

[0015] The embodiments of the present invention bring the following beneficial effects:

[0016] The embodiment of the present invention provides a method, device and electronic device for implementing the annotation function in a rich text editor. The method obtains an input signal generated in the rich text editor, determines the behavior type in the input signal, and if the behavior type is an annotation type, highlights the annotated content in the editing area in sequence based on a pre-set data rule to obtain a highlighted position, and then uses the pre-set annotation content copy as the rich text content corresponding to the highlighted position, stores the rich text content in a pre-set data container, renders the rich text content in the data container based on a pre-set data format and a pre-set rich text editing script, and fills the rendered rich text content into the annotation position corresponding to the highlighted position. In this way, users can effectively annotate text, which facilitates subsequent maintenance and use by users and improves user experience.

[0017] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.

[0018] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A flowchart of a method for implementing a marking function in a rich text editor provided by an embodiment of the present invention;

[0021] Figure 2 A flowchart of another method for implementing the annotation function in a rich text editor provided by an embodiment of the present invention;

[0022] Figure 3 A schematic diagram of the structure of a device for implementing a marking function in a rich text editor provided by an embodiment of the present invention;

[0023] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0025] Rich text is a document that is rendered and calculated by a rich text editor and then presented to the user. Currently, the most widely used rich text editors mostly use the HTML (Hypertext Markup Language) data format. This type of rich text editor can be embedded in the browser, supporting users to write, format and publish content on the web page.

[0026] However, such rich text editors usually have poor expansion capabilities and support limited rich text types. For example, the rich text editor does not support content annotation. In this case, users can only edit content separately, which makes it impossible for users to effectively annotate, distinguish or highlight text during editing, which brings inconvenience to users' subsequent maintenance and use, and reduces user experience.

[0027] Based on this, an embodiment of the present invention provides a method, device and electronic device for implementing the annotation function in a rich text editor. By obtaining an input signal generated in the rich text editor, the behavior type in the input signal is determined. If the behavior type is an annotation type, the annotated content in the editing area is highlighted in sequence based on a pre-set data rule to obtain a highlighted position, and then the pre-set annotation content copy is used as the rich text content corresponding to the highlighted position, the rich text content is stored in a pre-set data container, and the rich text content in the data container is rendered based on a pre-set data format and a pre-set rich text editing script, and the rendered rich text content is filled into the annotation position corresponding to the highlighted position. In this way, users can effectively annotate text, which facilitates subsequent maintenance and use by users and improves user experience.

[0028] To facilitate understanding of this embodiment, a method for implementing a marking function in a rich text editor disclosed in an embodiment of the present invention is first introduced in detail.

[0029] Example 1

[0030] The embodiment of the present invention provides a method for implementing a marking function in a rich text editor. Figure 1 A flowchart of a method for implementing a marking function in a rich text editor provided by an embodiment of the present invention.

[0031] like Figure 1 As shown, the method for implementing the annotation function in the rich text editor may include the following steps:

[0032] Step S101, obtaining an input signal generated in a rich text editor, and determining a behavior type in the input signal.

[0033] Among them, in the embodiment of the present invention, the rich text editor can be developed using JSON technology (JavaScript Object Notation), and the documents finally generated using the rich text editor will be saved in JSON format.

[0034] For example, the tags used by a rich text editor developed in HTML language are:

[0035] Paragraph 1

[0036] Paragraph 2

[0037] Among them, p represents a paragraph.

[0038] For example, the tag pair used by the rich text editor developed in JSON language is:

[0039] [{

[0040] "type":"paragraph",

[0041] "children":[{"text":"The first paragraph"}]

[0042] },{

[0043] "type":"paragraph",

[0044] "children":[{"text":"The second paragraph"}]

[0045] }]

[0046] The input signal is a signal generated when the user inputs rich text content according to the menu or shortcut keys of the rich text editor. The rich text content is the content for which the behavior takes effect, and the type of the rich text content is related to the type of behavior.

[0047] Step S102: If the behavior type is a marking type, highlight the marked contents in the editing area in sequence based on a preset data rule to obtain a highlighted position.

[0048] The editing area is included in the interactive page of the rich text editor, and the annotation type refers to the rich text content being the annotation content copy.

[0049] The behavior type may also be a special input behavior type, which refers to rich text content such as a table, a mathematical formula, a picture, and the like.

[0050] Among them, the pre-set data rules can specify the highlight color of the marked content, the data format corresponding to the marked content copy, etc.

[0051] Step S103: Use the preset annotation content as the rich text content corresponding to the highlighted position, and store the rich text content in a preset data container.

[0052] When storing rich text content, the rich text content needs to be formatted before being stored.

[0053] Step S104: Render the rich text content in the data container based on a preset data format and a preset rich text editing script.

[0054] The rich text editing script is to register the rich text attribute corresponding to the behavior type in the rich text editor, and then obtain the response according to the rich text attribute association.

[0055] Among them, the rich text content in the data container is converted into an operation corresponding to the annotation type according to the rich text editing script to complete the rendering.

[0056] Step S105, filling the rendered rich text content into the marked position corresponding to the highlighted position.

[0057] The annotation position is the filling position of the annotation content copy when annotating the annotated content.

[0058] Furthermore, the rich text editor can support collaborative annotation by multiple people. After the annotation of the rich text content is completed, the account name corresponding to the rich text content can be displayed for viewing and reference by users corresponding to other account names. The viewing and permissions of the annotated content can be set according to the actual situation. For example, the text area can be divided according to the task content, and each area can be assigned to different users. Users can refer to each other's annotated content, but users in different areas cannot edit the annotated content of users in other areas. Users in the same area can edit the annotated content of other users after applying for editing permissions, etc. Of course, you can also set a review password and an editing password. When multiple people collaborate on annotation, if you want to view the annotated content in other areas, you can enter the review password for viewing. If you need to edit, you can enter the editing password to obtain editing permissions.

[0059] Among them, after the first user completes the annotation, if the second user determines that there is an error in the annotated content, the second user can modify the error after obtaining the editing permission. However, since the format of the annotated content of the first user is more diverse and complex, the second user may not be able to restore the current format when making modifications. Therefore, when modifying the error, the editing area is selected and the editing mode is entered. The corresponding annotation process is determined and displayed based on the editing area; the error is modified based on the annotation process to ensure that the format of the modified content is consistent with the format of the content before modification.

[0060] The method for implementing the annotation function in the rich text editor provided by the embodiment of the present invention can obtain the input signal generated in the rich text editor, determine the behavior type in the input signal, and if the behavior type is the annotation type, highlight the annotated content in the editing area in sequence based on the pre-set data rules to obtain the highlighted position, and then use the pre-set annotation content copy as the rich text content corresponding to the highlighted position, store the rich text content in a pre-set data container, render the rich text content in the data container based on the pre-set data format and the pre-set rich text editing script, and fill the rendered rich text content into the annotation position corresponding to the highlighted position. In this way, the user can effectively annotate the text, which is convenient for the user's subsequent maintenance and use, and improves the user experience.

[0061] Example 2

[0062] The embodiment of the present invention also provides another method for implementing the annotation function in a rich text editor; this method is implemented on the basis of the method in the above embodiment.

[0063] Figure 2 A flowchart of another method for implementing the annotation function in a rich text editor provided by an embodiment of the present invention, such as Figure 2As shown, the method for implementing the annotation function in the rich text editor may include the following steps:

[0064] Step S201, obtaining an input signal generated in a rich text editor, and determining a behavior type in the input signal.

[0065] Specifically, determining the behavior type in the input signal may include: determining a generation method of the input signal; if the generation method is a menu method, obtaining the behavior type corresponding to each menu method based on a preset menu and behavior type mapping table; if the generation method is a secondary menu method of an instruction, determining that the behavior type is a special input behavior type.

[0066] The menu mode is a mode in which the user directly generates an input signal by clicking according to the menu guide in the rich text editor according to his own needs. The menu can be a normal menu, a shortcut menu or a shortcut provided by the rich text editor.

[0067] For example, select a specified position in the editing area with the mouse, and select an operation to be performed on the specified position in the menu, such as marking. In this case, the behavior type is the marking type.

[0068] The secondary menu mode of the command is a mode in which a secondary menu is displayed when the menu is clicked and an input signal is generated by clicking according to one's own needs. Special input behavior types may include: ordinary chart type, mathematical formula type, ordinary drawing type, and advanced drawing type.

[0069] Among them, ordinary chart types refer to data organized according to a two-dimensional data table and line charts, bar charts, and pie charts generated by the two-dimensional table; mathematical formula types can be LaTex mathematical expressions, for example, $x+y=z$; ordinary drawing types can be drawing data such as Gantt charts, flow charts, timing diagrams, and class diagrams based on Markdown text syntax; advanced drawing types can be graphic data generated by software or scripts that support manual drawing, for example, DrawIO data.

[0070] Step S202: If the behavior type is a special input behavior type, determine the special input corresponding to the special input behavior type; and update the rich text content in the data container based on the special input.

[0071] Among them, special input includes: characters containing " / math", " / mermaid" or " / uml". When the special input contains " / math", the special input behavior type is a mathematical formula type; when the special input contains " / mermaid", the special input behavior type is a common drawing type; when the special input contains " / uml", the special input behavior type is an advanced drawing type.

[0072] Step S203: If the behavior type is a marking type, highlight the marked contents in the editing area in sequence based on a preset data rule to obtain a highlighted position.

[0073] The editing area is included in the interactive page of the rich text editor.

[0074] It should be noted that step S203 is similar to the above step S102 and will not be described in detail here.

[0075] Step S204: Use the preset annotation content as the rich text content corresponding to the highlighted position, and store the rich text content in a preset data container.

[0076] Specifically, storing the rich text content in a preset data container may include: converting a data format of the rich text content into a data format; and storing the rich text content after the data format conversion into a corresponding data container.

[0077] Step S205, obtaining and activating a rich text editing script preloaded in a rich text editor corresponding to the behavior type.

[0078] Specifically, obtaining and activating a rich text editing script preloaded in a rich text editor corresponding to a behavior type may include: obtaining a rich text attribute corresponding to the behavior type; registering the rich text attribute in the rich text editor, and associating a responsive rich text editing script based on the rich text attribute.

[0079] Among them, by completing the registration of the rich text attributes corresponding to each behavior type in the rich text editor, the rich text editing script corresponding to each behavior type is activated or started.

[0080] For example, after the annotated content is annotated, it forms the following structure:

[0081] <span data-xid-anno="id"action-type="annotation"other-attr="..."> Rich text content For the action-type attribute, the behavior identified as annotation will execute the rich text editing script representing the annotation.

[0082] Step S206: Render the rich text content in the data container based on a preset data format and a preset rich text editing script.

[0083] Specifically, the rich text content in the data container is rendered based on a preset data format and a preset rich text editing script, including: if the data format is an annotation format, obtaining the annotated content, the highlighted position and the annotation content text; based on the rich text editing script, converting the rich text content in the data container into an operation corresponding to the annotation type.

[0084] Each data format type corresponds to a different rich text editing script. When the data format is a notation format, the rich text content is converted based on the rich text editing script corresponding to the notation format to achieve rendering.

[0085] Step S207, filling the rendered rich text content into the marked position corresponding to the highlighted position.

[0086] It should be noted that the rendered rich text content is separated from the rich text editor. After the rendering is completed, the corresponding annotation position is found and the annotation content is displayed. Usually, the behavior instructions in the rich text editor are accompanied by the corresponding rich text editing script to complete the rendering. All work is completed at one time. The annotation function needs to find the annotation position after the rendering is completed to complete the secondary rendering outside the editor. It is not within a task cycle.

[0087] The method for implementing the annotation function in the rich text editor provided by the embodiment of the present invention can update the rich text content in the data container according to the special input when the behavior type is a special input behavior type, and when the behavior category is a annotation type, after rendering the rich text content, the rendered rich text content leaves the rich text editor to find the corresponding annotation position, and displays the annotation content, so that the user can effectively annotate the text, which is convenient for the user's subsequent maintenance and use, and improves the user experience.

[0088] Example 3

[0089] Corresponding to the above method embodiment, the embodiment of the present invention provides a device for implementing the annotation function in a rich text editor, Figure 3 A schematic diagram of a structure of a device for implementing a marking function in a rich text editor provided by an embodiment of the present invention, such as Figure 3 As shown, the annotation function implementation device in the rich text editor may include:

[0090] The behavior type determination module 301 is used to obtain an input signal generated in the rich text editor and determine the behavior type in the input signal.

[0091] The highlight execution module 302 is used to highlight the annotated content in the editing area in sequence based on the preset data rules to obtain the highlight position if the behavior type is the annotation type; the editing area is included in the interactive page of the rich text editor.

[0092] The rich text content storage module 303 is used to use the preset annotation content copy as the rich text content corresponding to the highlighted position, and store the rich text content in a preset data container.

[0093] The rich text content rendering module 304 is used to render the rich text content in the data container based on a preset data format and a preset rich text editing script.

[0094] The marking module 305 is used to fill the rendered rich text content into the marked position corresponding to the highlighted position.

[0095] The device for implementing the annotation function in the rich text editor provided by the embodiment of the present invention can obtain the input signal generated in the rich text editor, determine the behavior type in the input signal, and if the behavior type is the annotation type, highlight the annotated content in the editing area in sequence based on the pre-set data rules to obtain the highlighted position, and then use the pre-set annotation content copy as the rich text content corresponding to the highlighted position, store the rich text content in a pre-set data container, render the rich text content in the data container based on the pre-set data format and the pre-set rich text editing script, and fill the rendered rich text content into the annotation position corresponding to the highlighted position. In this way, the user can effectively annotate the text, which is convenient for the user's subsequent maintenance and use, and improves the user experience.

[0096] In some embodiments, the behavior type determination module is also used to determine the generation method of the input signal; if the generation method is a menu method, the behavior type corresponding to each menu method is obtained based on a preset menu and behavior type mapping table; if the generation method is a secondary menu method of an instruction, the behavior type is determined to be a special input behavior type.

[0097] In some embodiments, the rich text content storage module is further used to determine the special input corresponding to the special input behavior type if the behavior type is a special input behavior type; and update the rich text content in the data container based on the special input.

[0098] In some embodiments, the rich text content rendering module is also used to obtain the annotated content, highlighted position and annotated content text if the data format is an annotation format; and convert the rich text content in the data container into an operation corresponding to the annotation type based on the rich text editing script.

[0099] In some embodiments, the rich text content rendering module is further used to obtain and activate a rich text editing script preloaded in a rich text editor corresponding to the behavior type.

[0100] In some embodiments, the rich text content rendering module is further used to obtain rich text attributes corresponding to the behavior type; register the rich text attributes in the rich text editor, and associate a responsive rich text editing script based on the rich text attributes.

[0101] In some embodiments, the rich text content storage module is further used to convert the data format of the rich text content into a data format; and store the rich text content after the data format conversion into a corresponding data container.

[0102] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0103] Example 4

[0104] The embodiment of the present invention also provides an electronic device for executing the annotation function implementation method in the above-mentioned rich text editor; see Figure 4 A structural schematic diagram of an electronic device is shown, which includes a memory 400 and a processor 401, wherein the memory 400 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor 401 to implement the annotation function implementation method in the above-mentioned rich text editor.

[0105] Further, Figure 4 The electronic device shown further includes a bus 402 and a communication interface 403 , and the processor 401 , the communication interface 403 and the memory 400 are connected via the bus 402 .

[0106] The memory 400 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 403 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 402 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0107] The processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 401. The above processor 401 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 400, and the processor 401 reads the information in the memory 400 and completes the steps of the method of the above embodiment in combination with its hardware.

[0108] An embodiment of the present invention also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the annotation function implementation method in the above-mentioned rich text editor. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0109] The computer program product for implementing the annotation function in a rich text editor provided in an embodiment of the present invention includes a computer-readable storage medium storing a non-volatile program code executable by a processor. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0110] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0111] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0112] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0113] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0114] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0115] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for implementing the annotation function in a rich text editor, characterized in that: The method comprises: Obtaining an input signal generated in the rich text editor, and determining a behavior type in the input signal; If the behavior type is a marking type, highlighting the marked contents in the editing area in sequence based on a preset data rule to obtain a highlight position; the editing area is included in the interactive page of the rich text editor; Using the pre-set annotation content copy as the rich text content corresponding to the highlighted position, and storing the rich text content in a pre-set data container; Rendering the rich text content in the data container based on a preset data format and a preset rich text editing script; Fill the rendered rich text content into the marked position corresponding to the highlighted position; The rich text editor supports multi-person collaborative annotation. After the annotation of the rich text content is completed, the account name corresponding to the rich text content is displayed for viewing and reference by users corresponding to other account names. For viewing and permissions of the annotated content, the text area is divided according to the task content, and each area is assigned to different users. Users can refer to each other's annotated content. Users in different areas cannot edit the annotated content of users in other areas. Users in the same area can edit the annotated content of other users after applying for editing permissions. After the first user completes the annotation, if the second user determines that there is an error in the annotated content, the second user modifies the error after obtaining editing permission; when the second user modifies the error, the area to be edited is selected and the editing mode is entered, and the corresponding annotation process is determined and displayed based on the area to be edited; the error is modified based on the annotation process to ensure that the format of the modified content is consistent with the format of the content before the modification.

2. The method according to claim 1, characterized in that The determining the behavior type in the input signal includes: Determining a method for generating the input signal; If the generation mode is a menu mode, obtaining the behavior type corresponding to each menu mode based on a preset menu and behavior type mapping table; If the generation mode is a secondary menu mode of the instruction, it is determined that the behavior type is a special input behavior type.

3. The method according to claim 2, characterized in that The method further comprises: If the behavior type is a special input behavior type, determining a special input corresponding to the special input behavior type; The rich text content in the data container is updated based on the special input.

4. The method according to claim 1, characterized in that: The rendering of the rich text content in the data container based on a preset data format and a preset rich text editing script includes: If the data format is a marked format, obtaining the marked content, the highlighted position and the marked content copy; The operation of converting the rich text content in the data container into an operation corresponding to the annotation type is performed based on the rich text editing script.

5. The method according to claim 1, characterized in that Before rendering the rich text content in the data container based on the preset data format and the preset rich text editing script, the method further includes: Obtain and activate a rich text editing script preloaded in a rich text editor corresponding to the behavior type.

6. The method according to claim 5, characterized in that The obtaining and activating a rich text editing script preloaded in a rich text editor corresponding to the behavior type includes: Get the rich text attribute corresponding to the behavior type; The rich text attribute is registered in the rich text editor, and a responsive rich text editing script is associated with the rich text attribute.

7. The method according to claim 1, characterized in that The storing the rich text content in a preset data container includes: Converting the data format of the rich text content into the preset data format; The rich text content after data format conversion is stored in the corresponding data container.

8. A device for implementing a marking function in a rich text editor, characterized in that: The method for implementing the annotation function in a rich text editor according to any one of claims 1 to 7, the device comprising: A behavior type determination module, used to obtain an input signal generated in the rich text editor and determine a behavior type in the input signal; A highlight execution module, for, if the behavior type is a marking type, sequentially highlighting the marked content in the editing area based on a preset data rule to obtain a highlight position; the editing area is included in the interactive page of the rich text editor; A rich text content storage module, used to use a preset annotation content copy as the rich text content corresponding to the highlighted position, and store the rich text content in a preset data container; A rich text content rendering module, used for rendering the rich text content in the data container based on a preset data format and a preset rich text editing script; The marking module is used to fill the rendered rich text content into the marking position corresponding to the highlighted position.

9. An electronic device, characterized in that: It includes a processor and a memory, the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the annotation function implementation method in the rich text editor according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method for implementing the annotation function in a rich text editor as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Rich text editing method and device, electronic equipment and computer readable storage medium

    CN116226563A