Rich-text editing method and device, electronic equipment, storage medium and product

By building a rich text editor using the operating system's input controls and interfaces, the lag and unsmooth scrolling issues of mobile terminal text editors are resolved, achieving a rich text editing experience with fast response and smooth interaction.

CN114492331BActive Publication Date: 2025-10-24BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210061647.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-19
Publication Date
2025-10-24
Estimated Expiration
2042-01-19

AI Technical Summary

Technical Problem

When existing text editors for mobile terminals are implemented using web technology, there are problems such as lag during editing, unsmooth sliding, and lack of interactive effects, and resources cannot be released in real time.

Method used

By leveraging the operating system's input controls and its application programming interface, a rich text editor can be built to directly edit text data and convert it into a preset rich text storage format, avoiding intermediate layer parsing and achieving fast response and smooth interaction.

Benefits of technology

It achieves fast response and smooth interaction in rich text editing, and has platform-specific features, such as long press and swipe to change position, which enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114492331B_ABST
    Figure CN114492331B_ABST
Patent Text Reader

Abstract

The present disclosure provides a rich text editing method and device, electronic equipment, storage medium and product, relates to the technical field of editors, and in particular to a rich text editor. The specific implementation scheme is as follows: obtaining text data in a rich text format to be edited; adding a rich text format to the text data based on an inputtable control of a system, and converting the rich text format into a preset rich text storage format; and saving the rich text format based on the preset rich text storage format. The editing of the rich text according to the present disclosure is fast in response and smooth in interaction with the user.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of editors, in particular to a rich text editor, and more particularly to a rich text editing method and device, an electronic device, a storage medium and a product. BACKGROUND

[0002] With the intelligentization of mobile terminals, users have gradually begun to use mobile terminals to edit text. In related technologies, the text editor of a mobile terminal is mainly realized through web technology. The mobile terminal uses a webpage as an editor, and runs an editor coded using front-end technology. SUMMARY

[0003] The present disclosure provides a rich text editing method, device, electronic device, storage medium and product.

[0004] According to a first aspect of the present disclosure, a rich text editing method is provided, comprising:

[0005] obtaining text data in a rich text format to be edited; adding a rich text format to the text data based on an inputtable control of a system, and converting the rich text format into a preset rich text storage format; and saving the rich text format based on the preset rich text storage format.

[0006] According to a second aspect of the present disclosure, a rich text editing device is provided, comprising:

[0007] an obtaining module configured to obtain text data in a rich text format to be edited; a processing module configured to add a rich text format to the text data based on an inputtable control of a system, and convert the rich text format into a preset rich text storage format; and a saving module configured to save the rich text format based on the preset rich text storage format.

[0008] According to a third aspect of the present disclosure, an electronic device is provided, comprising:

[0009] at least one processor; and a memory communicatively connected with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of the first aspect.

[0010] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method of the first aspect.

[0011] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method according to the first aspect.

[0012] It should be understood that the matters described herein are intended to be illustrative and are not intended to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0013] The accompanying drawings are used to better understand the present scheme and do not limit the present disclosure. Among them:

[0014] Figure 1 A flow diagram of a rich text editing method provided by an embodiment of the present disclosure is shown;

[0015] Figure 2 A flow diagram of a rich text editing method provided by an embodiment of the present disclosure is shown;

[0016] Figure 3 A flow diagram of determining a rich text format provided by an embodiment of the present disclosure is shown;

[0017] Figure 4 A flow diagram of rich text format conversion provided by an embodiment of the present disclosure is shown;

[0018] Figure 5 A flow diagram of restoring a rich text format provided by an embodiment of the present disclosure is shown;

[0019] Figure 6 A flow diagram of restoring a rich text format provided by an embodiment of the present disclosure is shown;

[0020] Figure 7 A flow diagram of displaying a rich text format provided by an embodiment of the present disclosure is shown;

[0021] Figure 8 A structural diagram of a rich text editing device provided by an embodiment of the present disclosure is shown;

[0022] Figure 9 A block diagram of an electronic device for implementing the rich text editing method of an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0023] Exemplary embodiments of the present disclosure are described herein below with reference to the accompanying drawings, in which various details are set forth to provide an understanding of the embodiments of the present disclosure. It will be apparent, however, to one skilled in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, for the purpose of clarity and a concise description, descriptions of well-known functions and constructions are omitted from the following description.

[0024] With the intelligence of mobile terminals, users have gradually started to use mobile terminals to edit texts. In related technologies, the text editor of a mobile terminal is mainly implemented through web technology. That is, the mobile terminal uses a web page as an editor and runs an editor coded using front-end technology. The principle is to set the content editable attribute of a div tag or a P tag to true, and the browser engine implements various functions such as an ordered list, an unordered list, picture insertion, and a back operation through a response function (for example, a document.execCommand() function), thereby implementing rich text editing.

[0025] Therefore, this method needs to use a front-end web page for real-time parsing, and if a rich text editor is constructed based on a front-end web page, there may be problems such as lagging during editing, unsmooth sliding, and lack of interactive effects, and when multiple resources are added, real-time perception of the sliding state cannot be performed, and therefore resources cannot be released according to the sliding situation.

[0026] Based on this, the present disclosure provides a rich text editing method and device. Through the inputtable control of the operating system and the application program interface thereof, different rich text formats are edited, so that intermediate layer parsing is not needed, the response is fast, the interaction is smooth, and functions with platform characteristics such as long-press sliding to change the position are provided.

[0027] The following embodiments will describe the rich text editing method and device in conjunction with the accompanying drawings.

[0028] Figure 1 A flowchart of a rich text editing method provided by an embodiment of the present disclosure is shown, as shown in FIG. 1, the method can include: Figure 1

[0029] In step S110, text data in a rich text format to be edited is acquired.

[0030] In an embodiment of the present disclosure, the rich text editor is constructed based on the application program interface of the terminal operating system and the inputtable control of the operating system. The rich text editor can acquire text data in a rich text format to be edited. The user can directly edit the input text data, or can select text data to be edited from the existing text data.​

[0031] In the present disclosure, the text data can be literal or inserted pictures and other resources.

[0032] In step S120, the text data is added with rich text format based on the inputtable control of the system, and the rich text format is converted into a preset rich text storage format.

[0033] In the present embodiment, after obtaining the text data to be edited, the text data to be edited is added with rich text format based on the inputtable control of the system. The rich text format can be bold, italic, strikeout, underline, quotation, ordered list, unordered list, etc.

[0034] In the present disclosure, the rich text format added to the text data can be one or multiple. After adding the rich text format, the added rich text format is converted into a preset rich text storage format, and the added rich text format is stored.

[0035] In step S130, the rich text format is saved based on the preset storage format.

[0036] In the present embodiment, the rich text format converted into the preset rich text storage format is stored in a specified location in correspondence with the text data.

[0037] By the rich text editing method provided in the present disclosure, the rich text format of the text data is edited by using the application program interface of the terminal operating system, which is quick in response and smooth in interaction with the user.

[0038] An exemplary, Figure 2 A flowchart of a rich text editing method provided in the present embodiment is shown in FIG. 1. Figure 2 As shown in FIG. 1, the user can input literal or insert pictures and other resources based on the rich text editor of the terminal. The input literal is added with rich text format, wherein the added rich text format can be one or multiple of bold, italic, strikeout, quotation, ordered list, unordered list, etc. After completing the editing of the rich text format, the edited rich text format is converted into a specified data conversion (JSON) format, and the specified data conversion format can also be converted into other data format.

[0039] Figure 3 A flowchart of determining rich text format provided in the present embodiment is shown in FIG. 2. Figure 3 As shown in FIG. 2, the method can include:

[0040] In step S210, the rich text editor is constructed based on the system application program interface and the inputtable control of the system.

[0041] In the embodiments of the present disclosure, the terminal is installed with an operating system, such as an Android operating system. An input (EditText) control is included in the framework of the Android operating system, and the control also provides a plurality of coding interfaces of rich text formats.

[0042] In the present disclosure, the rich text editor can be constructed based on the application program interface of the Android operating system and the EditText control.

[0043] In step S220, the coding interface included in the input control is acquired.

[0044] In the embodiments of the present disclosure, as described above, the EditText control provides a plurality of coding interfaces of rich text formats, such as a StyleSpan class coding interface, a URLSpan class coding interface, and the like.

[0045] In step S230, different rich text formats are defined for the rich text editor based on different types of coding interfaces.

[0046] In the embodiments of the present disclosure, different rich text formats can be defined for the rich text editor through different types of coding interfaces. For example, the rich text of different font formats, such as bold, italic, and the like, can be customized by inheriting the StyleSpan class coding interface. The rich text format with a link function can be defined by inheriting the URLSpan class coding interface, and the rich text format with a strike-through function can be implemented by inheriting the StrikethroughSpan class coding interface.

[0047] The present disclosure uses the coding interface included in the operating system to implement the rich text format, which is relatively stable and has the function of platform characteristics.

[0048] Figure 4 A flowchart of a rich text format conversion method provided by the embodiments of the present disclosure is shown in FIG. 3. Figure 4 The method can include the following steps.

[0049] In step S310, a corresponding relationship between the rich text format and the numerical value is acquired.

[0050] In the embodiments of the present disclosure, the corresponding numerical value is defined in advance for different rich text formats. For example, the numerical value of 1 is defined for the bold format in the rich text format, and the numerical value of 2 is defined for the underline format.

[0051] The corresponding numerical value defined in advance for each rich text format is acquired, so as to determine the numerical value corresponding to each rich text format.

[0052] In step S320, the numerical value corresponding to the added rich text format is determined based on the corresponding relationship.

[0053] In the embodiments of the present disclosure, the added rich text format corresponds to a value according to the correspondence between the obtained rich text format and the corresponding value. For example, the added rich text format is bold and underlined, and the added rich text format can be determined to be 1 and 2 according to the correspondence.

[0054] In step S330, the text data and the value are converted into a specified data exchange format.

[0055] In the embodiments of the present disclosure, the text data and the value representing the rich text format of the text data are converted into a specified data exchange format.

[0056] In the embodiments of the present disclosure, the stored text data and the corresponding rich text format can also be restored. Figure 5 A flowchart of restoring a rich text format according to an embodiment of the present disclosure is shown in FIG. 6. As shown in FIG. 6, the method can include the following steps. Figure 5

[0057] In step S410, in response to detecting an editing operation on the stored text data and the rich text format thereof, the text data and the value of the rich text format are parsed to obtain the text data and the corresponding rich text format.

[0058] In the embodiments of the present disclosure, if it is necessary to edit the stored text data and the rich text format thereof, the text data and the value of the rich text format are parsed to obtain the text data and the corresponding rich text format.

[0059] In step S420, the obtained rich text format is added to the text data based on the encoding interface.

[0060] In the embodiments of the present disclosure, the value of the text data and the rich text format of the text data are determined by parsing the text data and the value of the rich text format through a predefined value of the rich text format. The parsed rich text format is added to the text data through a different encoding interface.

[0061] In step S430, the text data and the corresponding rich text format are edited based on the inputtable control of the system.

[0062] In the embodiments of the present disclosure, the text data after adding the rich text format is displayed, and the text data is edited by taking the inputtable control as a carrier.

[0063] Figure 6 A flowchart of restoring a rich text format according to an embodiment of the present disclosure is shown in FIG. 6. As shown in FIG. 6, the method can include the following steps. Figure 6 ​As shown in , the stored data is obtained, that is, the stored text data and its rich text format are obtained, and according to the specified data format conversion rules, the stored text data and its rich text format are restored to the specified data exchange format. The unformatted text data and the corresponding rich text format are restored to rich text, displayed, and then editing can be continued.

[0064] In the embodiment of the present disclosure, the appearance of the rich text editor can also be defined according to the application program interface of the customized appearance. Figure 7 A schematic diagram of a process for displaying rich text format provided by an embodiment of the present disclosure is shown. Figure 7 As shown in , a rich text format icon is displayed in the display interface. The user can touch the icon to add rich text format to the text data based on the interactive interface.

[0065] In the embodiment of the present disclosure, an interface for a third-party rich text format is also included. The third party can obtain the rich text format based on the interface and convert the rich text format into the rich text format required by the third party.

[0066] In an embodiment of the present disclosure, in response to a rich text format of text data being added based on a front-end webpage, the rich text format with front-end webpage tags is converted to a preset rich text storage format. Alternatively, in response to a preset rich text storage format being edited based on a front-end webpage, the preset rich text storage format is converted to a rich text format with front-end webpage tags. In other words, the present disclosure can convert rich text edited using HTML tags into local rich text, and can also convert local rich text into a web format.

[0067] In this disclosure, the rich text editor constructed allows for rich text editing, including bold, italic, strikethrough, underline, custom links, and other formats. Paragraph formats include quotes, ordered lists, and unordered lists. You can select any location in the text data and change its paragraph format, and several different paragraph formats can also be converted between each other.

[0068] You can also use the built-in rich text editor to insert images, videos, and dividing lines at any location. You can also add other types of resources to the built-in rich text format, for example, adding actions that automatically respond to additions and deletions.

[0069] In the present disclosure, the rich text editor constructed can also count words, define the number of pictures, etc. The rich text editor can also realize the comparison function of drafts. It can also add tags to text data, such as emoji expressions.

[0070] In the present disclosure, a software development kit (SDK) of a rich text editor is decoupled from other applications, and functions such as image loading and video playing can be provided by the other applications. Thus, a business party can trim unnecessary functions.

[0071] based on the same principle as the method shown in Figure 1 Figure 8 A structure schematic diagram of a rich text editing device provided by an embodiment of the present disclosure is shown in FIG. 1. As shown in FIG. 1, the rich text editing device 100 can include: Figure 8

[0072] An obtaining module 101 is configured to obtain text data in a rich text format to be edited; a processing module 102 is configured to add a rich text format to the text data based on an inputtable control of a system, and convert the rich text format into a preset rich text storage format; and a saving module 103 is configured to save the rich text format based on the preset rich text storage format.

[0073] In an embodiment of the present disclosure, the processing module 102 is further configured to construct a rich text editor based on a system application program interface and a system inputtable control, obtain an encoding interface included in the inputtable control, and define different rich text formats for the rich text editor based on different types of the encoding interface.

[0074] In an embodiment of the present disclosure, the processing module 102 is configured to obtain a correspondence between the rich text format and a numerical value, determine a numerical value corresponding to the added rich text format based on the correspondence, and convert the text data and the numerical value into a specified data exchange format.

[0075] In an embodiment of the present disclosure, the obtaining module 101 is configured to obtain text data to be edited based on the inputtable control, or obtain text data to be edited based on a text file.

[0076] In an embodiment of the present disclosure, the processing module 102 is configured to, in response to detecting an editing operation on stored text data and a rich text format thereof, parse a numerical value of the text data and the rich text format to obtain text data and a corresponding rich text format, add the obtained rich text format to the text data based on an encoding interface, and edit the text data and the corresponding rich text format based on an inputtable control of a system.

[0077] In an embodiment of the present disclosure, the preset rich text storage format further includes a third-party rich text storage format.

[0078] In an embodiment of the present disclosure, if the third party is a front-end web page, the processing module 102 is further configured to:​​

[0079] In response to the rich text format based on the front-end webpage adding text data, the rich text format with the front-end webpage label is converted into a preset rich text storage format; or

[0080] In response to the rich text format based on the front-end webpage adding text data, the rich text format with the front-end webpage label is converted into a preset rich text storage format; or

[0081] In the technical solution of the present disclosure, the acquisition, storage and application of user personal information comply with relevant laws and regulations and do not violate public order and good customs.

[0082] According to the embodiments of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium and a computer program product.

[0083] Figure 8 A schematic block diagram of an example electronic device 200 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present disclosure described and / or claimed in this document.

[0084] As shown in Figure 2 The electronic device 200 includes a computing unit 201 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 202 or a computer program loaded from a storage unit 208 into a random access memory (RAM) 203. Various programs and data required for the operation of the electronic device 200 can also be stored in the RAM 203. The computing unit 201, the ROM 202, and the RAM 203 are connected to each other through a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.

[0085] Various components in the electronic device 200 are connected to the I / O interface 205, including an input unit 206, such as a keyboard, a mouse, etc.; an output unit 207, such as various types of displays, a speaker, etc.; the storage unit 208, such as a magnetic disk, an optical disk, etc.; and a communication unit 209, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 209 allows the electronic device 200 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0086] The computing unit 201 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 201 performs various methods and processes described above, such as the method rich text editing. For example, in some embodiments, the method rich text editing can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 208. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 200 via the ROM 202 and / or the communication unit 209. When the computer program is loaded onto the RAM 203 and executed by the computing unit 201, one or more steps of the method rich text editing described above can be performed. Alternatively, in other embodiments, the computing unit 201 can be configured to perform the method rich text editing by any other appropriate means, such as by means of firmware.

[0087] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0088] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.

[0089] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, 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), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0090] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0091] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0092] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0093] It should be understood that the various forms of flow shown above can be used to reorder, add, or remove steps. For example, the steps recited in the present disclosure can be performed in parallel, in series, or in a different order, without limitation herein, so long as the desired results of the technology disclosed in the present disclosure are achieved.

[0094] The specific embodiments discussed above do not constrain the scope of the present disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and alternatives can be made to the specific embodiments without departing from the spirit and principles of the present disclosure. Any such modifications, equivalents, and alternatives should be considered within the scope of the present disclosure.

Claims

1. A method for editing a rich text, comprising: obtaining text data in a rich text format to be edited; adding a rich text format to the text data based on a system inputtable control, and converting the rich text format into a preset rich text storage format; the preset rich text storage format comprises a third-party rich text storage format; based on the preset rich text storage format, saving the rich text format; wherein the rich text format is determined by: based on a system application program interface and a system inputtable control, constructing a rich text editor; the system inputtable control is an inputtable control in an operating system framework; obtaining an encoding interface included in the inputtable control; the encoding interface is a native application program encoding interface of an operating system; based on different types of the encoding interface, defining different rich text formats for the rich text editor; if the third party is a front-end webpage; the method further comprises: in response to adding a rich text format of text data based on a front-end webpage, converting the rich text format with a front-end webpage tag into a preset rich text storage format; or in response to editing a stored preset rich text storage format based on a front-end webpage, converting the preset rich text storage format into a rich text format with a front-end webpage tag; the converting the rich text format into a preset rich text storage format comprises: obtaining a correspondence between the rich text format and a numerical value; based on the correspondence, determining a numerical value corresponding to the added rich text format; converting the text data and the numerical value into a specified data exchange format.

2. The method of claim 1, wherein, the obtaining text data in a rich text format to be edited comprises: based on the inputtable control, obtaining text data to be edited, or based on a text file, obtaining text data to be edited.

3. The method of claim 1, wherein, the method further comprises: in response to detecting an editing operation on stored text data and its rich text format, parsing a numerical value of the text data and the rich text format to obtain text data and a corresponding rich text format; based on an encoding interface, adding the obtained rich text format to the text data; based on a system inputtable control, continuing to edit the text data and its corresponding rich text format. 4.An apparatus for editing a rich text, comprising: an obtaining module, configured to obtain text data in a rich text format to be edited; a processing module, configured to add a rich text format to the text data based on a system inputtable control, and convert the rich text format into a preset rich text storage format; the preset rich text storage format comprises a third-party rich text storage format; a saving module, configured to save the rich text format based on the preset rich text storage format; the processing module is further configured to: based on a system application program interface and a system inputtable control, construct a rich text editor; the system inputtable control is an inputtable control in an operating system framework; obtain an encoding interface included in the inputtable control; the encoding interface is a native application program encoding interface of an operating system; based on different types of the encoding interface, define different rich text formats for the rich text editor; if the third party is a front-end webpage; the processing module is further configured to: In response to the rich text format based on the front-end webpage adding text data, the rich text format with the front-end webpage label is converted into a preset rich text storage format. Or In response to the stored preset rich text storage format based on the front-end webpage editing, the preset rich text storage format is converted into a rich text format with a front-end webpage label. The processing module is configured to: Obtain the corresponding relationship between the rich text format and the numerical value; Determine the numerical value corresponding to the added rich text format based on the corresponding relationship; Convert the text data and the numerical value into a specified data exchange format.

5. The apparatus of claim 4, wherein, The obtaining module is configured to: Obtain the text data to be edited based on the inputtable control, or obtain the text data to be edited based on a text file.

6. The apparatus of claim 4, wherein, The processing module is configured to: In response to detecting an editing operation on the stored text data and its rich text format, parse the numerical value of the text data and the rich text format to obtain the text data and the corresponding rich text format; Add the obtained rich text format to the text data based on the encoding interface; Edit the text data and its corresponding rich text format based on the inputtable control of the system.

7. An electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-3.

8. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method according to any one of claims 1-3.

9. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-3.

Citation Information

Patent Citations

  • Webpage text editing method and device, terminal equipment and storage medium

    CN113255301A