Text editing method, device, electronic device and storage medium

By determining the style control characters in the text editing interface and updating the display mode in real time, the problem of low document creation efficiency during lightweight markup language editing is solved, real-time style preview and what you see are what you get.

CN112507670BActive Publication Date: 2025-05-06BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011476182.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-14
Publication Date
2025-05-06
Estimated Expiration
2040-12-14

AI Technical Summary

Technical Problem

When editing documents using lightweight markup language, the styles set by preview text content need to be continuously rendered, resulting in low document creation efficiency.

Method used

A new input mode is provided, by determining the style control characters when the input text content is received on the text editing interface, and updating the display mode of the text content in real time based on these symbols, thereby achieving the effect of what is seen and what is obtained.

Benefits of technology

It improves the efficiency of document creation, enables users to see the input text styles in real time without frequent rendering, and improves the text creation experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112507670B_ABST
    Figure CN112507670B_ABST
Patent Text Reader

Abstract

The present application discloses a text editing method, device, electronic device and storage medium. The method comprises: in a first input mode, in response to receiving input text content in a text editing interface, determining a style control character; based on the style control character, updating the target content in the text content from the first display mode to the second display mode. A new input mode is realized, which can apply the style matching the style control character to the input text content in real time, so as to achieve a WYSIWYG effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a text editing method, device, electronic device, and storage medium. Background Art

[0002] The current mainstream text editing tools include word, wps, etc. When using these tools for text editing, you can use the formatting tools to adjust the style of the text to make the text more beautiful and easy to read. However, for editors, they need to frequently switch to the toolbar to modify the format of the text, which makes the editor's text creation experience poor. In order to overcome the shortcomings of the above tools, there are some lightweight markup languages ​​that allow people to write documents in a plain text format that is easy to read and write. These languages ​​support pictures, charts, and mathematical formulas, and are widely used by people to edit documents to improve the fluency and efficiency of writing.

[0003] In the process of implementing the present disclosure, the inventors found that when editing a document using a lightweight markup language, if one wants to preview the style set for the text content, one must continuously render the input content to determine whether to make adjustments, resulting in low document creation efficiency. Summary of the invention

[0004] The embodiments of the present disclosure provide a text editing method, device, electronic device and storage medium, which realize a new input mode and can convert the display mode of the input text content in real time to achieve a what-you-see-is-what-you-get effect.

[0005] In a first aspect, an embodiment of the present disclosure provides a text editing method, the method comprising:

[0006] In the first input mode, in response to receiving text content input in the text editing interface, determining a style control character;

[0007] Based on the style control character, target content in the text content is updated from a first display mode to a second display mode.

[0008] In a second aspect, an embodiment of the present disclosure further provides a text editing device, the device comprising:

[0009] A determination module, configured to determine a style control character in response to receiving input text content in the text editing interface in a first input mode;

[0010] The display module is used to update the target content in the text content from the first display mode to the second display mode based on the style control character.

[0011] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:

[0012] one or more processors;

[0013] a storage device for storing one or more programs,

[0014] When one or more programs are executed by one or more processors, the one or more processors implement the text editing method as in any embodiment of the present disclosure.

[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a text editing method as in any embodiment of the present disclosure.

[0016] The embodiments of the present disclosure provide a text editing method, device, electronic device and storage medium. In a first input mode, in response to receiving input text content in a text editing interface, a style control character is determined; based on the style control character, the target content in the text content is updated from the first display mode to the second display mode, thereby realizing a new input mode, which can apply a style matching the style control character to the input text content in real time, and achieve a WYSIWYG effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0018] Figure 1 is a flow chart of a text editing method provided in Embodiment 1 of the present disclosure;

[0019] FIG. 2( a ) is a flow chart of a text editing method provided in Embodiment 2 of the present disclosure;

[0020] FIG2( b ) is a schematic diagram of a style of text content provided in Embodiment 2 of the present disclosure;

[0021] FIG2( c ) is a schematic diagram of a reproducing style control symbol provided in the second embodiment of the present disclosure;

[0022] FIG3( a ) is a flow chart of a text editing method provided in Embodiment 3 of the present disclosure;

[0023] FIG3( b ) is a schematic diagram of text content after style deletion provided in Embodiment 3 of the present disclosure;

[0024] FIG3( c ) is a schematic diagram of all texts in a selected style provided in Embodiment 3 of the present disclosure;

[0025] Figure 4is a flow chart of a text editing method provided by Embodiment 4 of the present disclosure;

[0026] Figure 5 is a structural schematic diagram of a text editing device provided by an embodiment of the present disclosure;

[0027] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0028] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0029] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0030] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0031] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0032] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0033] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0034] In the process of implementing the present disclosure, the applicant of the present disclosure found that in some embodiments, when editing a document using a lightweight markup language, if you want to preview the style set for the text content, you must continuously render the input content to determine whether to adjust it, resulting in low document creation efficiency. In view of this, the technical solution of the embodiment of the present disclosure determines a style control character in response to receiving input text content in a text editing interface in a first input mode; based on the style control character, the target content in the text content is updated from the first display mode to the second display mode, thereby realizing a new input mode, which can apply a style matching the style control character to the input text content in real time, achieving a what-you-see-is-what-you-get effect.

[0035] Embodiment 1

[0036] Figure 1 This is a flow chart of a text editing method provided by the first embodiment of the present disclosure. The present embodiment of the present disclosure is applicable to the case where the style of the input text content is displayed in real time during the process of editing text using a lightweight markup language. The method can be executed by the text editing device provided by the embodiment of the present disclosure. The device can be implemented in software and / or hardware and can generally be integrated in an electronic device. The method of the embodiment of the present disclosure specifically includes:

[0037] Optional, such as Figure 1 As shown, the method in the embodiment of the present disclosure may include the following steps:

[0038] Step 110 : in the first input mode, in response to receiving text content inputted in the text editing interface, determining a style control character.

[0039] It should be noted that the first input mode in this embodiment can specifically be a text input mode that can achieve WYSIWYG. The first input mode can be a function deployed separately in an editing tool that supports WYSIWYG, or can be a function deployed in a traditional text editor (WORD or WPS, etc.). The style control character can specifically be a style tag in a lightweight markup language, which is used to set a specified style for a limited text content.

[0040] It should be noted that in the first input mode, if input text content is received in the text editing interface, a style control symbol can be obtained from the input text content so that a corresponding style can be set for the text content defined by the style control symbol according to the type of the style control symbol.

[0041] Optionally, the text editing interface may include: an outline view editing interface, or a mind map view editing interface.

[0042] Among them, in the outline view editing interface, the hierarchical relationship between text contents can be displayed through bullet points and indentation. In the mind map view editing interface, the relationships between themes at all levels can be represented by a hierarchical diagram of subordination and correlation, and memory links can be established between the theme keywords and images, colors, etc.

[0043] It should be noted that since different users are used to different view editing interfaces, in order to accommodate the view editing interfaces of different types of users, both the outline view editing interface and the mind map view editing interface are set in the text editing interface. Thus, after obtaining the document, the user can load the document into the text editing interface that conforms to the editing habit, and then edit the document in this interface.

[0044] Step 120: Based on the style control symbol, update the target content in the text content from the first display mode to the second display mode.

[0045] It should be noted that the input text content can include: style control symbols and the target content defined by the style control symbols. For example, for the input text content "*This is italic*", "This is italic" is the target content defined by the style control symbol, and the "*" before and after the target content are style control symbols.

[0046] Of course, the text content does not necessarily only include style control symbols and target content, and may also include other content. For example, for the input text content "Is this *italic*?", the two "*" before and after are style control symbols, "italic" is the target content, and "Is this" and "?" are other content. Even the input text content may only include other content and does not include style control symbols and target content. For example, for the input text content "Is this italic?", there are no style control symbols, and accordingly there is no target content.

[0047] It should be noted that the first display mode can refer to the display mode that does not display the style of the target content, while the second display mode can refer to the display mode that displays the style of the target content. In order to achieve the what-you-see-is-what-you-get effect, after obtaining the style control symbol from the text content, the target style corresponding to the style control symbol can be determined, and format adjustment matching the target style can be performed on the target content, so that the target content is updated from the first display mode to the second display mode.

[0048] Specifically, assume that the input text content is "This is a *italic*". After determining that the style control symbols are the two "*" before and after, it is determined that this style control symbol is used to set the italic style for the content it defines. Thus, the target content "italic" is adjusted to the italic format, so that the target content is updated from the first display mode "italic" to the second display mode "italic".

[0049] The disclosed embodiments provide a text editing method, device, electronic device, and storage medium. In a first input mode, in response to receiving input text content in a text editing interface, a style control character is determined; based on the style control character, the target content in the text content is updated from the first display mode to the second display mode, thereby realizing a new input mode, which can apply a style matching the style control character to the input text content in real time, thereby achieving a WYSIWYG effect. In addition, in the present embodiment, a function of switching the view editing interface is provided in the text editing interface, so that the WYSIWYG first input mode is supported under the mind map, taking into account the WYSIWYG capability.

[0050] Embodiment 2

[0051] FIG2(a) is a flow chart of a text editing method provided by Embodiment 2 of the present disclosure. The present disclosure embodiment can be combined with the optional solutions in the above implementation. In the present disclosure embodiment, based on Embodiment 1, the operation of setting the hiding and displaying of the style control symbol in the input text content is specifically described.

[0052] As shown in FIG. 2( a ), the method of the embodiment of the present disclosure specifically includes:

[0053] Step 210: In the first input mode, in response to receiving input text content in the text editing interface, determine a style control character.

[0054] Step 220: Based on the style control character, update the target content in the text content from the first display mode to the second display mode.

[0055] Optionally, the method may further include: in response to the input cursor moving out of the position where the style control symbol corresponding to the target content is located, hiding the style control symbol.

[0056] It should be noted that, since the style control symbol is displayed while the style of the target content is displayed, the style visibility is poor, thus giving the user a poor preview experience. Therefore, in order to improve the visibility of the style, a style control symbol hiding trigger mechanism is set, that is, when the input cursor moves out of the position where the style control symbol corresponding to the target content is located, the style control symbol is hidden.

[0057] Optionally, the style control includes a first position qualifier and a second position qualifier; in response to the input cursor moving out of the position where the style control corresponding to the target content is located, hiding the style control may include: hiding the style control in response to the input cursor moving out of the position where the first position qualifier or the second position qualifier in the style control is located.

[0058] It should be noted that the style control symbol can include a first position qualifier and a second position qualifier. For example, in the italic style control symbol, the "*" before the defined target content can be the first position qualifier, and the "*" after the defined target content can be the second position qualifier. When it is detected that the input cursor is not within the range defined by the first position qualifier and the second position qualifier, that is, the input cursor is not at the position of the first position qualifier, the position of the second position qualifier, or the position between the first position qualifier and the second position qualifier, it is considered that the input cursor has moved out of the position where the style control symbol is located, and the style control symbol is hidden and not displayed to the user, as shown in Figure 2(b).

[0059] Among them, the ways to move the input cursor out of the position where the style control symbol is located can include: moving the input cursor left and right through the left and right arrow keys, or moving the input cursor up and down through the up and down arrow keys, or clicking the enter key, or clicking the home key, etc.

[0060] Optionally, the style control symbol includes a first position qualifier and a second position qualifier; in response to the input cursor moving out of the position where the style control symbol corresponding to the target content is located, hiding the style control symbol can include: in response to the input cursor moving out along the first direction of the first position qualifier in the style control symbol or the input cursor moving out along the second direction of the second position qualifier in the style control symbol, hiding the style control symbol.

[0061] It should be noted that the input cursor can move out of the position where the style control symbol is located from the first direction corresponding to the first position qualifier or the second direction corresponding to the second position qualifier respectively. Specifically, assuming that the input text content is "Is this an *italic*?", and the current position of the input cursor is between "斜" and "体", then if the input cursor moves left to any position to the left of "个", it is considered that the input cursor has moved out of the position where the style control symbol is located along the first direction of the first position qualifier, and if the input cursor moves right to any position to the right of "吗", it is considered that the input cursor has moved out of the position where the style control symbol is located along the second direction of the second position qualifier.

[0062] Optionally, it can also include: in response to the input cursor moving out of the position where the style control symbol corresponding to the target content is located in the current input line, hiding the style control symbol.

[0063] Among them, considering that when the Enter key is clicked to hide the style control symbol, the input cursor will jump to the next line, and the input cursor needs to be moved back to the previous line to continue editing the text content, which will interrupt the continuity of editing the text content. Therefore, in this embodiment, it can be set that the style control symbol is hidden only when it is detected that the input cursor moves out of the position where the style control symbol is located in the current input line. If the input cursor moves out of the position where the style control symbol is located by wrapping the line, the style control symbol cannot be hidden.

[0064] Optionally, the method may further include: in response to the input cursor moving to the position where the style control symbol corresponding to the target content is located, displaying the style control symbol.

[0065] It should be noted that, after the target content is styled, the style control symbol corresponding to the style will be hidden and not displayed to the outside. Therefore, if you want to view the style control symbol that matches the style of the target content in the text editing interface, or want to modify the target content, such as modifying the text content of the target content, replacing the style of the target content, or superimposing a new style on the target content, you need to reproduce the style control symbol first. Based on this, the present embodiment sets a re-reproduction trigger mechanism for the style control symbol, that is, when it is detected that the input cursor moves to the position where the style control symbol corresponding to the target content is located, the style control symbol is redisplayed, as shown in FIG2(c).

[0066] Optionally, the style control includes a first position qualifier and a second position qualifier; in response to the input cursor moving to the position of the style control corresponding to the target content, displaying the style control may include: in response to the input cursor moving to the position where the first position qualifier or the second position qualifier in the style control is located, displaying the style control.

[0067] It should be noted that the style control character may include a first position qualifier and a second position qualifier. For example, in the italic style control character, the "*" located before the defined target content may be the first position qualifier, and the "*" located after the defined target content may be the second position qualifier. When it is detected that the input cursor moves to the range defined by the first position qualifier and the second position qualifier, that is, when the input cursor moves to the position of the first position qualifier, the position of the second position qualifier, or the position between the first position qualifier and the second position qualifier, it is considered that the input cursor moves to the position where the style control character is located, and the style control character may be displayed, as shown in FIG. 2(c).

[0068] Among them, the way to move the input cursor to the position where the style control symbol is located may include: moving the input cursor left and right using the left and right arrow keys, or moving the input cursor up and down using the up and down arrow keys, or clicking the enter key, or clicking the home key, etc.

[0069] Optionally, the style control symbol includes a first position qualifier and a second position qualifier; in response to the input cursor moving to the position where the style control symbol corresponding to the target content is located, hiding the style control symbol may include: in response to the input cursor moving to the position where the style control symbol is located along the first direction of the first position qualifier in the style control symbol, or the input cursor moving to the position where the style control symbol is located along the second direction of the second position qualifier in the style control symbol, displaying the style control symbol.

[0070] It should be noted that the input cursor can move to the position where the style control symbol is located from the first direction corresponding to the first position qualifier or the second direction corresponding to the second position qualifier respectively. Specifically, assuming the input text content is "Is this an *italic*?", and the current position of the input cursor is between "is" and "a", the input cursor can move to the position where the style control symbol is located by moving right along the first direction, that is, any position in "*italic*". If the current position of the input cursor is to the right of "?", the input cursor can move to the position where the style control symbol is located by moving left along the second direction.

[0071] Optionally, it may further include: in response to the input cursor moving to the position where the style control symbol corresponding to the target content is located in the current input line, displaying the style control symbol.

[0072] Among them, considering that when the style control symbol is displayed by clicking the enter key, the input cursor will jump to the next line, and the input cursor needs to be moved back to the previous line to continue editing the text content, which will interrupt the coherence of editing the text content. Therefore, in this embodiment, it can be set that the style control symbol is only displayed when it is detected that the input cursor moves to the position where the style control symbol is located in the current input line. If the input cursor moves to the position where the style control symbol is located by line break, the style control symbol cannot be displayed.

[0073] Optionally, the style control symbol is used to set the target content to the hyperlink style; displaying the style control symbol may include: obtaining a hyperlink that matches the target content; constructing a floating window that matches the style control symbol and the hyperlink, and displaying the floating window below the target content.

[0074] It should be noted that for the style control symbol [target content] (hyperlink) corresponding to the hyperlink style, it is necessary to bind the target content with the URL (hyperlink) of the web page to be redirected, rather than just setting the style of the target content. Therefore, when the style control symbol corresponding to the hyperlink style is to be displayed, it is necessary to first obtain the hyperlink matching the target content, then construct a floating window matching the style control symbol and the hyperlink, display the hyperlink and the style control symbol that limits the hyperlink in the form of a floating window, and display the style control symbol that limits the target content in the original position.

[0075] It should be noted that when modifying a hyperlink corresponding to the target content, considering that the hyperlink is relatively long, if the input cursor is moved sequentially to the position to be modified in the hyperlink, it may be necessary to move the input cursor many times, that is, the cursor movement efficiency is low.

[0076] In order to improve the efficiency of moving the input cursor, after constructing a floating window that matches the style control symbol and the hyperlink, the floating window can be displayed directly below the target content. When modifying the hyperlink in the floating window, you only need to click the downward arrow key to move the input cursor to the middle position of the hyperlink, and then move the input cursor left and right to the position to be modified, thereby reducing the number of times the input cursor is moved and improving input efficiency.

[0077] The disclosed embodiments provide a text editing method, device, electronic device and storage medium. By determining a style control symbol in response to receiving input text content in a text editing interface in a first input mode; based on the style control symbol, updating the target content in the text content from the first display mode to the second display mode, a new input mode is implemented, and a style matching the style control symbol can be applied to the input text content in real time to achieve a what-you-see-is-what-you-get effect. In addition, in this embodiment, a cursor-sensitive style control symbol hiding mechanism is set to provide users with a better visual experience, and it can be more intuitive to determine whether the style setting of the target content is correct, and a cursor-sensitive style control symbol display mechanism is set to flexibly display the style control symbol corresponding to the target content, so that users can modify the target content or the style of the target content. In addition, in this embodiment, for the style control symbol of the hyperlink style, the interactive details of the hyperlink are reset to improve input efficiency.

[0078] Embodiment 3

[0079] FIG3(a) is a flow chart of a text editing method provided in Embodiment 3 of the present disclosure. The present disclosure embodiment can be combined with the optional solutions in the above embodiments. In the present disclosure embodiment, based on Embodiment 1, a specific description is given of using shortcut keys to operate style control symbols or target content in input text content.

[0080] As shown in FIG. 3( a ), the method of the embodiment of the present disclosure specifically includes:

[0081] Step 310: In the first input mode, in response to receiving input text content in the text editing interface, determine a style control character.

[0082] Step 320: Based on the style control character, update the target content in the text content from the first display mode to the second display mode.

[0083] Optionally, the method may further include: locating a style control symbol and / or a target content in the text content in response to a received target shortcut command; and performing an operation matching the target shortcut command on the style control symbol and / or the target content.

[0084] It should be noted that, in order to further improve the input efficiency in the first input mode, this embodiment provides a function of supporting shortcut keys to operate the style control symbols or target content in the input text content. The shortcut keys may specifically refer to a predefined key combination that has a specified operation on the style control symbols and / or target content. For example, a shortcut key may be defined. The style control symbol used to delete the hit style. The shortcut key Ctrl+A is defined to select all text in the hit style.

[0085] Optionally, in response to a received target shortcut command, locating style control characters in the text content, and / or target content may include: identifying the current position of the input cursor when the target shortcut command is detected; locating style control characters in the text content, and / or target content based on the current position of the input cursor and the type of the target shortcut command.

[0086] For example, as shown in the text content diagram of FIG2(c), since the input cursor is in the bold style, it can be considered that the bold style is hit by the input cursor. The target shortcut key is detected. The corresponding target shortcut command will identify the current position of the input cursor, and then search for style control characters on both sides from the current position of the cursor to locate the style control character that matches the target shortcut command, and then locate the target content defined by the style control character.

[0087] Optionally, executing the operation matching the target shortcut command may include: updating the target content in the text content from the second display mode to the first display mode, or selecting all the content of the target content.

[0088] It should be noted that when executing an operation that matches the target shortcut command, if it is determined that the target shortcut command corresponds to a shortcut key That is, if the type of the target shortcut command is determined to be a delete style, the located target content is updated from the second display mode to the first display mode, and a schematic diagram of the text content after the style is deleted is obtained as shown in Figure 3(b). If it is determined that the target shortcut command corresponds to the shortcut key Ctrl+A, that is, if the type of the target shortcut command is determined to be a content selection, all the text of the located target content is selected, as shown in Figure 3(c).

[0089] The disclosed embodiments provide a text editing method, device, electronic device, and storage medium. In the first input mode, in response to receiving input text content in the text editing interface, a style control character is determined; based on the style control character, the target content in the text content is updated from the first display mode to the second display mode, thereby realizing a new input mode, which can apply a style matching the style control character to the input text content in real time, thereby achieving a WYSIWYG effect. In addition, by providing a shortcut key function, the input efficiency in the first input mode is improved while taking WYSIWYG into account.

[0090] Embodiment 4

[0091] Figure 4 This is a flow chart of a text editing method provided by Embodiment 4 of the present disclosure. The present disclosure embodiment can be combined with the optional solutions in the above embodiments. Based on Embodiment 1, the present disclosure embodiment provides a function of switching input modes in a text editing interface, and a function of multiple users co-editing the same online document at the same time.

[0092] like Figure 4 As shown, the method of the embodiment of the present disclosure specifically includes:

[0093] Step 410: In the first input mode, in response to receiving input text content in the text editing interface, determine a style control character.

[0094] Step 420: Based on the style control character, update the target content in the text content from the first display mode to the second display mode.

[0095] Optionally, it may also include: in response to a second input mode switching instruction, obtaining the target content in the first input mode displayed in the text editing interface, wherein, in the second input mode, the display mode of the input text content is adjusted in real time through a pre-set display mode; converting the target content in the first input mode into the target content in the second input mode, and displaying the target content in the second input mode in the text editing interface.

[0096] It should be noted that, in order to meet the input requirements of different types of users, this embodiment provides a function of switching input modes in the text editing interface, that is, the user can freely switch between the provided first input mode and the second input mode.

[0097] Among them, the first input mode specifically refers to an input mode that supports what you see is what you get, and the second input mode specifically refers to an input mode that can use the toolbar in traditional editors such as Word and WPS to set the style of text content, and the settings take effect in real time.

[0098] It should be noted that if the current text editing interface is in the first input mode and a switching instruction from the first input mode to the second input mode is detected, the target content in the first input mode currently displayed in the text editing interface is obtained, and then the target content adapted to the first input mode is converted into target content adapted to the second input mode according to the mapping relationship from the first input mode to the second input mode, that is, the target content is converted from a state in which the style is set through a style control symbol to a state in which the style is set through a toolbar, and the target content in the second input mode is displayed in the text editing interface.

[0099] Optionally, when multiple users access text content at the same time, the first user is in a first input mode and the second user is in a second input mode, wherein, in the second input mode, the display mode of the input text content is adjusted in real time through a pre-set display mode. It may also include: in the text display page of the second user, updating in real time the text editing content input in real time by the first user in the text display page; determining a style control symbol in the text editing content, and based on the style control symbol, updating the display mode of the target editing content in the text editing content.

[0100] It should be noted that this embodiment allows multiple users to access the same online document at the same time, and the input modes of each user may be different, for example, the first user is in the first input mode, and the second user is in the second input mode. Each user has the authority to edit the text content in the document, but only one user is allowed to edit the text content at the same time.

[0101] Since the online document can display the input of the other party in real time, the text editing content input by other users in real time in the text display page can be updated in real time in each user's text display page, and the display mode of the target editing content in the text editing content can be updated in real time. For example, the target editing content in the first display mode is updated to the target editing content in the second display mode in real time.

[0102] For example, if the first user inputs "**bold**" in real time in the text display page, then "bold" is displayed in real time in the text display page of the second user. If the first user only inputs half of the style control symbol in the text display page, for example, "**bold", then "**bold" is displayed in real time in the text display page of the second user. That is, although the text editing content input by the first user in real time can be displayed in real time in the text display page of the second user, the target editing content of the corresponding style can be loaded in the text display page of the second user only after the first user inputs the complete style control symbol.

[0103] The embodiments of the present disclosure provide a text editing method, device, electronic device and storage medium. In a first input mode, in response to receiving input text content in a text editing interface, a style control character is determined; based on the style control character, the target content in the text content is updated from the first display mode to the second display mode, thereby realizing a new input mode, which can apply a style matching the style control character to the input text content in real time, thereby achieving a what-you-see-is-what-you-get effect. In addition, a switching function of the input mode is provided in the text editing interface to meet the needs of different types of users for input modes; and multiple users are allowed to use different types of input modes to collaboratively edit the same online document at the same time.

[0104] Embodiment 5

[0105] Figure 5 is a schematic diagram of the structure of a text editing device provided by an embodiment of the present disclosure. The device can be implemented in software and / or hardware, and can generally be integrated into an electronic device that executes the method. Figure 5 As shown, the device may include:

[0106] Determining module 501, configured to determine a style control character in response to receiving text content inputted in a text editing interface in a first input mode;

[0107] The display module 502 is used to update the target content in the text content from the first display mode to the second display mode based on the style control character.

[0108] Furthermore, the device also includes:

[0109] The hiding module is used for hiding the style control symbol in response to the input cursor moving out of the position where the style control symbol corresponding to the target content is located.

[0110] Furthermore, the hiding module is further used to: in response to the input cursor moving out of the position where the style control symbol corresponding to the target content is located in the current input line, hide the style control symbol.

[0111] Furthermore, the device also includes:

[0112] The rendering module is used for displaying the style control symbol in response to the input cursor moving to the position where the style control symbol corresponding to the target content is located.

[0113] Further, the style control character includes a first position qualifier and a second position qualifier;

[0114] The hiding module is specifically used to hide the style control character in response to the input cursor moving out of the position where the first position qualifier or the second position qualifier in the style control character is located.

[0115] Further, the style control character includes a first position qualifier and a second position qualifier;

[0116] The hiding module is specifically used to hide the style control character in response to the input cursor moving out along the first direction of the first position qualifier in the style control character or the input cursor moving out along the second direction of the second position qualifier in the style control character.

[0117] Furthermore, the style control character is used to set the target content to a hyperlink style;

[0118] Reproduction module, specifically for:

[0119] Get hyperlinks matching the target content;

[0120] Construct a floating window that matches the style control character and the hyperlink, and display the floating window below the target content.

[0121] Furthermore, the device also includes:

[0122] A shortcut operation module, configured to locate a style control symbol in the text content and / or a target content in response to a received target shortcut command;

[0123] Performs an action matching the target shortcut command on the style control and / or target content.

[0124] Furthermore, the quick operation module is used to:

[0125] When a target shortcut command is detected, the current position of the input cursor is identified;

[0126] According to the current position of the input cursor and the type of the target shortcut command, the style control symbol in the text content and / or the target content are located.

[0127] Furthermore, the quick operation module is used to:

[0128] The target content in the text content is updated from the second display mode to the first display mode, or the entire content of the target content is selected.

[0129] Furthermore, the text editing interface includes: an outline view editing interface, or a mind map view editing interface.

[0130] Furthermore, the device also includes:

[0131] A mode switching module, configured to obtain target content in the first input mode displayed in the text editing interface in response to a second input mode switching instruction, wherein in the second input mode, the display mode of the input text content is adjusted in real time by a preset display mode;

[0132] The target content in the first input mode is converted into the target content in the second input mode, and the target content in the second input mode is displayed in the text editing interface.

[0133] Furthermore, when multiple users access text content at the same time, the first user is in a first input mode, and the second user is in a second input mode, wherein in the second input mode, the display mode of the input text content is adjusted in real time by a preset display mode, and the device further includes:

[0134] A collaboration module, used to update in real time, in a text display page of a second user, the text editing content input in real time by the first user in the text display page;

[0135] A style control character is determined in the text editing content, and based on the style control character, a display mode of a target editing content in the text editing content is updated.

[0136] The text editing device provided in the embodiment of the present disclosure belongs to the same inventive concept as the text editing method provided in the above-mentioned embodiments. The technical details not fully described in the embodiment of the present disclosure can be referred to the above-mentioned embodiments, and the embodiment of the present disclosure has the same beneficial effects as the above-mentioned embodiments.

[0137] Embodiment 6

[0138] Reference below Figure 6, which shows a schematic diagram of the structure of an electronic device 600 suitable for implementing the embodiment of the present disclosure. The electronic device in the embodiment of the present disclosure may be a device corresponding to the backend service platform of the application, or may be a mobile terminal device installed with an application client. Specifically, the electronic device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0139] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0140] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0141] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0142] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a 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, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0143] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with 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"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0144] Embodiment 7

[0145] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0146] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the internal process of the electronic device is executed: in a first input mode, in response to receiving input text content in a text editing interface, a style control character is determined; based on the style control character, the target content in the text content is updated from the first display mode to the second display mode.

[0147] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or combinations thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0148] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0149] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0150] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0151] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0152] According to one or more embodiments of the present disclosure, a text editing method is provided, the method comprising:

[0153] In the first input mode, in response to receiving input text content in the text editing interface, a style control character is determined; based on the style control character, target content in the text content is updated from the first display mode to the second display mode.

[0154] According to one or more embodiments of the present disclosure, the above method further includes: in response to the input cursor moving out of the position where the style control symbol corresponding to the target content is located, hiding the style control symbol.

[0155] According to one or more embodiments of the present disclosure, the above method further includes: in response to the input cursor moving out of the position where the style control symbol corresponding to the target content is located in the current input line, hiding the style control symbol.

[0156] According to one or more embodiments of the present disclosure, the above method further includes: in response to the input cursor moving to the position where the style control symbol corresponding to the target content is located, displaying the style control symbol.

[0157] According to one or more embodiments of the present disclosure, in the above method, the style control character includes a first position qualifier and a second position qualifier;

[0158] In response to the input cursor moving out of the position where the style control symbol corresponding to the target content is located, hiding the style control symbol, including:

[0159] In response to the input cursor moving out of the position where the first position qualifier or the second position qualifier in the style control is located, hiding the style control.

[0160] According to one or more embodiments of the present disclosure, in the above method, the style control character includes a first position qualifier and a second position qualifier;

[0161] In response to the input cursor moving out of the position where the style control symbol corresponding to the target content is located, hiding the style control symbol, including:

[0162] In response to the input cursor moving out in a first direction of a first position qualifier in the style control or the input cursor moving out in a second direction of a second position qualifier in the style control, the style control is hidden.

[0163] According to one or more embodiments of the present disclosure, in the above method, the style control symbol is used to set the target content as a hyperlink style;

[0164] Display style controls include:

[0165] Get hyperlinks matching the target content;

[0166] Construct a floating window that matches the style control character and the hyperlink, and display the floating window below the target content.

[0167] According to one or more embodiments of the present disclosure, the above method also includes: in response to the received target shortcut command, locating the style control symbol and / or the target content in the text content; performing an operation matching the target shortcut command on the style control symbol and / or the target content.

[0168] According to one or more embodiments of the present disclosure, in the above method, in response to a received target shortcut command, locating the style control symbols and / or the target content in the text content includes: when the target shortcut command is detected, identifying the current position of the input cursor; locating the style control symbols and / or the target content in the text content according to the current position of the input cursor and the type of the target shortcut command.

[0169] According to one or more embodiments of the present disclosure, in the above method, executing an operation matching the target shortcut command includes: updating the target content in the text content from the second display mode to the first display mode, or selecting all the content of the target content.

[0170] According to one or more embodiments of the present disclosure, in the above method, the text editing interface includes: an outline view editing interface, or a mind map view editing interface.

[0171] According to one or more embodiments of the present disclosure, the above method also includes: in response to a second input mode switching instruction, obtaining the target content in the first input mode displayed in the text editing interface, wherein, in the second input mode, the display mode of the input text content is adjusted in real time through a pre-set display mode; converting the target content in the first input mode into the target content in the second input mode, and displaying the target content in the second input mode in the text editing interface.

[0172] According to one or more embodiments of the present disclosure, in the above method, when multiple users access text content at the same time, the first user is in a first input mode and the second user is in a second input mode, wherein, in the second input mode, the display mode of the input text content is adjusted in real time through a pre-set display mode, and the method also includes: in the text display page of the second user, updating in real time the text editing content input in real time by the first user in the text display page; determining a style control symbol in the text editing content, and based on the style control symbol, updating the display mode of the target editing content in the text editing content.

[0173] According to one or more embodiments of the present disclosure, a text editing device is provided, the device comprising:

[0174] A determination module, configured to determine a style control character in response to receiving input text content in the text editing interface in a first input mode;

[0175] The display module is used to update the target content in the text content from the first display mode to the second display mode based on the style control character.

[0176] According to one or more embodiments of the present disclosure, an electronic device is provided, the electronic device including:

[0177] one or more processors;

[0178] a storage device for storing one or more programs,

[0179] When one or more programs are executed by one or more processors, the one or more processors implement the text editing method as in any embodiment of the present disclosure.

[0180] According to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, a text editing method as described in any embodiment of the present disclosure is implemented.

[0181] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0182] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0183] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A text editing method, characterized in that: include: In a first input mode, in response to receiving input text content in a text editing interface, determining a style control character; wherein the first input mode is a text input mode supporting WYSIWYG; and the style control character is included in the input text content; Based on the style control character, the target content in the text content is updated from the first display mode to the second display mode; wherein the target content is the text content defined by the style control character.

2. The method according to claim 1, characterized in that Also includes: In response to the input cursor moving out of the position where the style control symbol corresponding to the target content is located, hiding the style control symbol.

3. The method according to claim 1, characterized in that Also includes: In response to the input cursor moving out of the position where the style control symbol corresponding to the target content is located in the current input line, hiding the style control symbol.

4. The method according to claim 1, characterized in that: Also includes: In response to the input cursor moving to the position where the style control symbol corresponding to the target content is located, the style control symbol is displayed.

5. The method according to claim 2, characterized in that: The style control includes a first position qualifier and a second position qualifier; In response to the input cursor moving out of the position where the style control symbol corresponding to the target content is located, hiding the style control symbol, comprising: In response to the input cursor moving out of the position where the first position qualifier or the second position qualifier in the style control is located, hiding the style control.

6. The method according to claim 2, characterized in that The style control includes a first position qualifier and a second position qualifier; In response to the input cursor moving out of the position where the style control symbol corresponding to the target content is located, hiding the style control symbol, comprising: In response to an input cursor moving out along a first direction of a first position qualifier in the style control or an input cursor moving out along a second direction of a second position qualifier in the style control, hiding the style control.

7. The method according to claim 4, characterized in that The style control symbol is used to set the target content to a hyperlink style; Display the style control symbols, including: Acquire a hyperlink matching the target content; A floating window matching the style control symbol and the hyperlink is constructed, and the floating window is displayed below the target content.

8. The method according to claim 1, characterized in that: Also includes: In response to the received target shortcut command, locate the style control symbol in the text content and / or the target content; An operation matching the target shortcut command is performed on the style control symbol and / or the target content.

9. The method according to claim 8, characterized in that In response to the received target shortcut command, locating the style control symbol in the text content and / or the target content includes: When the target shortcut command is detected, identifying the current location of the input cursor; The style control symbol in the text content and / or the target content are located according to the current position of the input cursor and the type of the target shortcut command.

10. The method according to claim 8, characterized in that Execute an operation matching the target shortcut command, including: The target content in the text content is updated from the second display mode to the first display mode, or the entire content of the target content is selected.

11. The method according to any one of claims 1 to 10, characterized in that The text editing interface includes: an outline view editing interface, or a mind map view editing interface.

12. The method according to any one of claims 1 to 10, characterized in that Also includes: In response to the second input mode switching instruction, the target content in the first input mode displayed in the text editing interface is acquired, wherein in the second input mode, the display mode of the input text content is adjusted in real time by a preset display mode; The target content in the first input mode is converted into the target content in the second input mode, and the target content in the second input mode is displayed in the text editing interface.

13. The method according to any one of claims 1 to 9, characterized in that: When multiple users access the text content at the same time, the first user is in a first input mode, and the second user is in a second input mode, wherein in the second input mode, the display mode of the input text content is adjusted in real time by a preset display mode, and the method further includes: In the text display page of the second user, updating the text editing content input in real time by the first user in the text display page in real time; A style control character is determined in the text editing content, and based on the style control character, a display mode of a target editing content in the text editing content is updated.

14. A text editing device, characterized in that: include: A determination module, configured to determine a style control character in response to receiving input text content in a text editing interface in a first input mode; wherein the first input mode is a text input mode supporting WYSIWYG; and the style control character is included in the input text content; The display module is used to update the target content in the text content from the first display mode to the second display mode based on the style control character; wherein the target content is the text content defined by the style control character.

15. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 13.

16. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.

Citation Information

Patent Citations

  • Client-side customization and rendering of web content

    CN111552897A