Text editing method, device, equipment, medium and program product

Through a cross-platform text editor built with HTML5 technology, the problem of high development and deployment cost of mobile terminal text editors on different platforms is solved, and the timely and efficient iteration of text editing functions and the improvement of user experience is achieved.

CN117873454BActive Publication Date: 2025-07-18BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410232369.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-29
Publication Date
2025-07-18
Estimated Expiration
2044-02-29

AI Technical Summary

Technical Problem

The development and deployment of existing mobile terminal text editors on different platforms is high, and cannot meet the timely and efficient iteration needs, and the business capacity upgrade cost is high.

Method used

Use HTML5 technology that supports cross-platform use to build a text editor, adjust the display of text editing pages by recording interactive data, realize cross-platform text editing functions, and reduce development and deployment costs.

Benefits of technology

It realizes timely and efficient iteration of text editing functions, reduces development and deployment costs, and ensures user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117873454B_ABST
    Figure CN117873454B_ABST
Patent Text Reader

Abstract

The present disclosure provides a text editing method, apparatus, device, and medium, relating to the field of computer technologies, and specifically to the field of mobile terminal technologies. The specific implementation solution of the text editing method is as follows: in response to a first operation on the text displayed in the text editing page, record interaction data corresponding to the first operation; and adjust the text displayed in the text editing page according to the interaction data. Among them, the text editing page is the display page of a text editor, and the text editor is constructed using a target technology, and the target technology supports cross-platform use of the text editor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technologies, specifically to the fields of technologies such as mobile terminals, and particularly to a text editing method, apparatus, device, medium, and program product. Background Art

[0002] With the development of computer technologies, mobile terminals have become one of the commonly used text editing terminals for people. For example, people can use the text editor installed in a mobile terminal to generate text, and can also use the text editor to edit and modify existing text.

[0003] Since there are many types of mobile terminals running on different platforms in the market, it is necessary to develop and deploy text editors for different platforms, which cannot meet the requirement of timely and efficient iteration of text editors, and the cost of upgrading the business capabilities of text editors is high. Summary of the Invention

[0004] The present disclosure aims to provide a text editing method, apparatus, device, and medium that are conducive to reducing the upgrade cost of text editors and facilitating the efficient iteration of text editors.

[0005] According to a first aspect of the present disclosure, there is provided a text editing method, including: in response to a first operation on text displayed in a text editing page, recording interaction data corresponding to the first operation; and adjusting the text displayed in the text editing page according to the interaction data. Wherein, the text editing page is a display page of a text editor, and the text editor is constructed using a target technology that supports cross-platform use of the text editor.

[0006] According to a second aspect of the present disclosure, there is provided a text editing apparatus, including: a data recording module for, in response to a first operation on text displayed in a text editing page, recording interaction data corresponding to the first operation; and a page adjustment module for adjusting the text displayed in the text editing page according to the interaction data; wherein, the text editing page is a display page of a text editor; the text editor is constructed using a target technology that supports cross-platform use of the text editor.

[0007] According to a third aspect of the present disclosure, there is provided an electronic device, including: 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, and the instructions are executed by the at least one processor to enable the at least one processor to execute the text editing method provided by the present disclosure.

[0008] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the text editing method provided by the present disclosure.

[0009] According to a fifth aspect of the present disclosure, there is provided a computer program product, including a computer program / instructions, the computer program / instructions being stored on at least one of a readable storage medium and an electronic device, and the computer program / instructions, when executed by a processor, implementing the text editing method provided by the present disclosure.

[0010] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. Description of the Drawings

[0011] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:

[0012] Figure 1 is a schematic diagram of an application scenario of the text editing method and device according to an embodiment of the present disclosure;

[0013] Figure 2 is a schematic flowchart of the text editing method according to an embodiment of the present disclosure;

[0014] Figure 3 is a schematic diagram of the adjustment of the text editing page when at least part of the text is selected according to an embodiment of the present disclosure;

[0015] Figure 4 is a schematic diagram of the adjustment of the text editing page when text is inserted according to an embodiment of the present disclosure;

[0016] Figure 5 is a schematic diagram of the adjustment of the text editing page when the selected text is adjusted according to an embodiment of the present disclosure;

[0017] Figure 6 is a schematic diagram of the adjustment of the text editing page when a virtual keyboard is displayed according to an embodiment of the present disclosure;

[0018] Figure 7 is an implementation architecture diagram of a text editor for implementing the text editing method according to an embodiment of the present disclosure;

[0019] Figure 8 is a structural block diagram of the text editing device according to an embodiment of the present disclosure; and

[0020] Figure 9 is a block diagram of an electronic device for implementing the text editing method according to an embodiment of the present disclosure. Detailed Embodiments

[0021] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, descriptions of well-known functions and structures are omitted in the following description for clarity and conciseness.

[0022] Currently, mature mobile text editors are usually implemented using React Native framework technology or a combination of React Native framework technology and HTML5 technology. While providing basic content editing functions for users, the text editor can also perform complex operations such as selection, layout, and style editing. At the same time, it can also provide artificial intelligence (AI) interaction functions for the business, such as automatically inserting text, replacing text, and changing text styles. Among them, text editors implemented using React Native framework technology need to be separately developed, debugged, tested, and deployed for different mobile platforms.

[0023] To reduce development costs while ensuring the user experience, a combination of React Native framework technology and HTML5 technology is generally used to implement the text editor. Specifically, the React Native framework technology is used to control the virtual keyboard and interaction panel in the text editor, and the HTML5 technology is used to present the text content and trigger interactions in the text editor. This combined approach collaboratively realizes the complete functions of the text editor through two-way communication between the React Native framework technology and the HTML5 technology. However, some functions implemented using the React Native framework technology still need to be developed and deployed for different mobile platforms, and still cannot meet the timely and efficient iteration requirements. Moreover, the cost of upgrading the business capabilities of the text editor remains relatively high.

[0024] To solve the above problems, the present disclosure provides a text editing method, apparatus, device, medium, and program product implemented by a text editor, where the text editor is constructed using a target technology that supports cross-platform use. The following first combines Figure 1 Describe the application scenarios of the method and apparatus provided by the present disclosure.

[0025] Figure 1 It is a schematic diagram of the application scenario of the text editing method and apparatus according to an embodiment of the present disclosure.

[0026] As Figure 1As shown, the application scenario 100 of this embodiment may include terminal devices 101, 102, and 103, and at least some of the terminal devices 101, 102, and 103 operate based on different platforms. For example, the terminal device 101 may operate based on the IOS platform, the terminal device 102 may operate based on the Android platform, and the terminal device 103 may operate based on the HarmonyOS platform.

[0027] The application scenario 100 may further include a text editor 110, which can be understood as an application (APP). The text editor 110 may be built based on a target technology that supports cross-platform use, for example, it may be built based on HTML5 technology. The text editor 110 can be applied to the terminal devices 101, 102, and 103, that is, the terminal devices 101, 102, and 103 can all install and run the text editor 110 so that users can use the text editor 110 to edit text. It can be understood that the text editor 110 can be directly run by terminal devices operating on different platforms, or the text editor 110 can be simply adjusted based on the platforms relied on by the terminal devices so that the text editor 110 can be run by terminal devices operating on different platforms. The present disclosure does not limit this. It can be understood that the workload of such a simple adjustment is much smaller than that of developing and deploying a text editor for different mobile platforms based on the React Native framework technology, and the adjustment cost is significantly reduced.

[0028] It can be understood that the text editor 110 can be used to execute the text editing method provided in the embodiments of the present disclosure to adjust the text displayed on the display page of the text editor 110 according to actual needs. Correspondingly, the text editor 110 may integrate the text editing device provided in the embodiments of the present disclosure.

[0029] It should be understood, Figure 1 the numbers and types of the terminal devices 101, 102, and 103 in are merely illustrative. According to the implementation requirements, there may be any numbers and types of terminal devices 101, 102, and 103.

[0030] The following will be described in detail in conjunction with Figures 2 to 6 the text editing method provided by the present disclosure.

[0031] Figure 2 is a schematic flowchart of the text editing method according to the embodiments of the present disclosure.

[0032] As Figure 2 shown, the text editing method 200 of this embodiment may include operation S210 to operation S220.

[0033] In operation S210, in response to a first operation on the text displayed in the text editing page, interaction data corresponding to the first operation is recorded.

[0034] According to an embodiment of the present disclosure, the text editing page may specifically be a display page of a text editor. The text editor therein may be constructed using a target technology that supports cross-platform use of the text editor. For example, the target technology may be HTML5 (Hyper Text Markup Language 5, the fifth generation of hypertext markup language) technology, and the code implementing the text editor may be written in HTML5 language. The HTML5 technology has the characteristic of cross-platform and can run on different devices and systems; secondly, the HTML5 technology supports the display and interaction of multimedia and can achieve a more rich and diverse user experience; thirdly, the HTML5 technology has strong extensibility and flexibility, and developers can expand and customize it through related technologies such as JavaScript; in addition, the HTML5 technology also has good maintainability and scalability, which is convenient for developers to perform subsequent maintenance and upgrades.

[0035] It can be understood that in addition to the HTML5 technology, the text editor can also be constructed using cross-platform solutions similar to Apache Cordova and Phone Gap, which allow the use of Web technologies to develop cross-platform mobile applications.

[0036] According to an embodiment of the present disclosure, the text editing page may, for example, include a display area for the text. The first operation on the displayed text may, for example, be an operation where the touch position is in the display area of the text, and this operation may, for example, include click operations, drag operations, swipe operations, etc. The interaction data corresponding to the first operation may, for example, include the position information of the touch point where the first operation is performed in the text editing page, the type of the first operation, etc., and the present disclosure does not limit this.

[0037] In one embodiment, the text editing page may further include, for example, a control (ControlBar) area for editing text, etc. The text editing page may also display a virtual keyboard, etc. according to requirements. Among them, the control area for editing text may include, for example, a control area located at the top of the text editing page and / or a control area that is default located at the bottom of the text editing page. One or more of the following controls may be displayed in the control area: a control for saving text, a control for exporting text, a control for generating new text, a return control, a control for undoing typing, a control for repeating typing, a font format editing control, a paragraph format editing control, etc. In a preferred embodiment, the controls displayed in the control area may further include at least one of the following: an expansion control, a continuation control, an AI writing control, a voice input control, etc., so as to achieve intelligent editing of text.

[0038] In operation S220, according to the interaction data, adjust the text displayed in the text editing page.

[0039] According to an embodiment of the present disclosure, it is possible to first determine whether it is necessary to adjust the text displayed in the text editing page according to the interaction data. When it is determined that adjustment is required, then adjust the text displayed in the text editing page. It can be understood that when it is determined that adjustment is not required, the adjustment operation on the text displayed in the text editing page can be understood as an operation to keep the displayed text unchanged, specifically, it can be not performing any operation.

[0040] For example, when determining whether it is necessary to adjust the displayed text, it is possible to first determine whether the text to be edited by the user is completely displayed according to the interaction data. If it is not completely displayed, then it is determined that the displayed text needs to be adjusted. Among them, the text to be edited may include, for example, the context of a predetermined range of the text corresponding to the cursor position, or the selected text. Among them, in order to make the text to be edited by the user be completely displayed, the adjustment operation on the text displayed in the text editing page may include a sliding operation on the displayed text.

[0041] For example, when determining whether it is necessary to adjust the displayed text, it is possible to first determine whether the text to be edited by the user can be located in the displayed page according to the interaction data and subsequent operations on the text editing page. If it cannot be located, then it is determined that the displayed text needs to be adjusted. Among them, in order to facilitate locating the text to be edited by the user, the adjustment operation on the text displayed in the text editing page may include a selection operation on the text to be edited, or an operation of highlighting the text to be edited. It can be understood that the selection operation here is a simulated selection operation without the need for the user to touch.

[0042] The text editing method according to the embodiments of the present disclosure is implemented by relying on a text editor constructed using target technology. Since the text editor is constructed using target technology, this text editor can be used across platforms, and the text editing method according to the embodiments of the present disclosure can be implemented across platforms. Compared with the related art, it can reduce the development and deployment costs of text editing functions and facilitate the timely and efficient iteration of text editing functions.

[0043] In one embodiment, it is possible to determine whether it is necessary to adjust the text displayed on the text editing page and determine a specific adjustment strategy based on the recorded interaction data corresponding to the first operation and the second operation on the target element in the text editing page after the first operation. The target element may be an element used to edit the displayed text. For example, the target element may be a font format editing control, a paragraph format editing control, an expansion control, a continuation control, an AI writing control, a virtual keyboard, etc.

[0044] For example, since the text editor is constructed using target technology, that is, the control of the virtual keyboard and the interaction panel in the text editor, as well as the presentation and interaction triggering of the text content are all implemented using target technology, there will be a problem of only one focus in the text editing page. For example, when a user needs to edit all or part of the text displayed, the cursor will first be positioned at the text to be edited, and then the target element will be clicked. When the target element is clicked, since there can only be one focus, the focus at the cursor position will disappear, which will cause the user to be unable to locate the text to be edited through the page. To solve this technical problem, for example, it is possible to simulate the selection of the text to be edited by adjusting the text displayed on the text editing page in response to the second operation.

[0045] Figure 3 It is a schematic diagram of the adjustment of the text editing page when at least part of the text is selected according to the embodiments of the present disclosure.

[0046] As Figure 3 shown, in this embodiment 300, the text editing page 310 includes a display area 311 of the text, a control area 312 located at the top of the text editing page, a control area 313 located at the bottom of the text editing page, and a virtual keyboard 314. It can be understood that the virtual keyboard 314 may be displayed only when a triggering condition is met, and the triggering condition may include, for example, clicking on any position in the display area 311 of the text.

[0047] In this Embodiment 300, the first operation on the text may, for example, include an operation of selecting at least part of the text. For example, the selected text may include "AI creation emerges as the times require". Since any position in the text display area 311 needs to be clicked before the first operation is performed, the virtual keyboard 314 may be displayed in real time before the first operation is performed. In this case, the recorded interaction data may, for example, include the position information of at least part of the selected text in the text editing page 310. It should be noted that the control area 313 may, for example, be located at the bottom of the text editing page by default. When the virtual keyboard 314 is displayed, the position of the control area 313 may be moved up above the virtual keyboard 314.

[0048] After the first operation, the user may, for example, click on a target element (which may be, for example, the font format editing control 3131 in the control area 313) in the text editing page (i.e., the second operation).

[0049] At this time, in the related art, because the functions of both the text display area 311 and the control area 313 are built based on the target technology, there can only be one focus in the text editing page, that is, the text editing page 310 will become the text editing page 320. In this text editing page 320, the focus is on the text format "body text". According to this text editing page 320, the user cannot know the text they have selected.

[0050] In the embodiment of the present disclosure, in response to the second operation, based on the recorded interaction data, the position information of at least part of the selected text "AI creation emerges as the times require" in the text editing page 310 may be determined first. Subsequently, at least part of the text "AI creation emerges as the times require" may be simulated as selected according to this position information, that is, the text editing page 310 will become the text editing page 330. In this text editing page 330, "AI creation emerges as the times require" is simulated as selected, and there are two foci in this page 330. One focus is on the simulated selected text "AI creation emerges as the times require", and the other focus is on the text format "body text".

[0051] In this way, the embodiment of the present disclosure can avoid the technical problem of poor user experience caused by only having one focus in the text editor built only based on the target technology in the related art by adjusting the displayed text. Through the embodiment of the present disclosure, while reducing the development and deployment costs of the text editing function and facilitating the timely and efficient iteration of the text editing function, the user experience can be guaranteed.

[0052] In one embodiment, the first operation may include, for example, an operation of clicking on the starting position or the ending position of any text paragraph in the displayed text, and the second operation may include an operation of changing the paragraph format. Correspondingly, the interaction data recorded in response to the first operation may at least include: the position of the cursor in the text editing page and the relative position between the cursor and the text paragraphs in the displayed text. When adjusting the text displayed in the text editing page, the fourth position information of the target paragraph whose paragraph format needs to be changed in the text editing page may first be determined according to the recorded position information of the cursor and the relative position between the cursor and the text paragraph. Specifically, the text paragraph closest to the position where the cursor is located may be used as the target paragraph, and then the position of the target paragraph may be determined according to the relative position. For example, the relative position may include the relative position between the starting position of the text paragraph and the cursor, and the relative position between the ending position of the text paragraph and the cursor. Subsequently, the target paragraph may be simulated to be selected according to this fourth position information. In this way, when the user clicks on the paragraph format editing control for changing the paragraph format, the user can intuitively see the paragraph whose paragraph format needs to be changed according to the result of the simulated selection. While or after the target paragraph is simulated to be selected, in this embodiment, the paragraph format may be determined according to the second operation, and the paragraph format of the target paragraph may be adjusted according to the determined paragraph format. Among them, the paragraph format determined according to the second operation may be, for example, the paragraph format corresponding to the touch point of the second operation.

[0053] Figure 4 It is a schematic diagram of the adjustment of the text in the text editing page when inserting text according to an embodiment of the present disclosure.

[0054] As Figure 4 shown, in Embodiment 400, the second operation on the target element may include, for example, a click operation on the "Continue Writing" control, and a click operation on the "Insert Below" control or the "Replace Selected" control displayed in the text editing page 410 after clicking the "Continue Writing" control. In other words, the second operation may include an operation of inserting text or an operation of replacing text. Correspondingly, the first operation may include, for example, an operation of clicking on the text where continuation writing is needed in the display area of the text, or an operation of selecting the text where continuation writing is needed. The interaction data recorded in response to the first operation may include the position information of the cursor in the text editing page 410.

[0055] In this embodiment, when text needs to be inserted, the operation of adjusting the text displayed on the text editing page can first determine the page height required to display the inserted text on the text editing page according to the inserted text. For example, the page height can be determined according to the font size and line spacing at the cursor position, and the number of lines required for the inserted text to occupy. Among them, the number of lines required for the inserted text to occupy can be determined according to the text volume of the inserted text, for example. Subsequently, the text displayed on the text editing page can be adjusted according to the determined page height and the position information of the cursor. Specifically, the height below the cursor in the text display area can be determined first according to the position information of the cursor, and then whether the text displayed on the text editing page 410 needs to be adjusted can be determined according to this height and the page height required to display the inserted text. If the height below the cursor in the display area is greater than or equal to the page height required to display the inserted text, the displayed text may not be adjusted. Otherwise, the displayed text can be adjusted so that the adjusted displayed text includes the inserted text. In this way, it is convenient for the user to view the inserted text through the adjusted displayed text, which is beneficial to improving the efficiency of the user's text editing and the user experience.

[0056] Specifically, if the height below the cursor in the display area is less than the page height required to display the inserted text, the sliding height by which the text in the text display area needs to slide to display any text can be determined according to the page height and the position information of the cursor. Subsequently, the text displayed on the text editing page is slid according to this sliding height, and the inserted text is inserted into the slid text. Through this embodiment, the text editing page 410 can be changed to the text editing page 420, for example.

[0057] For example, the difference between the page height required to display the inserted text and the height below the cursor can be used as the sliding height required to display the inserted text, and the text displayed on the text editing page is slid according to this sliding height. For example, the sum of the difference between the two heights and a predetermined value can also be used as the sliding height to improve the aesthetics of the text editing page after sliding. Among them, when determining the height below the cursor, for example, the height of the text display area on the text editing page can be determined first according to the height of other areas (such as the control area and the display area of the virtual keyboard) except the text display area on the page, and then the height of the area below the cursor in the text display area can be determined according to the total number of text lines where the cursor position is located and the text lines above the cursor position in the text display area, the font size and line spacing of the text, and the height of the text display area, etc.

[0058] In one embodiment, when adjusting the text displayed on the text editing page such that the adjusted displayed text includes inserted text, for example, the position of the cursor can also be adjusted so that the cursor is located at the start position or the end position of the inserted text, facilitating subsequent editing of the text by the user. Taking the cursor being located at the end position as an example, based on the page height required to display the inserted text and the recorded cursor position information, after determining the sliding of the text displayed on the text editing page, the position of the end of the inserted text in the text editing page 420 can be determined. Subsequently, the position of the cursor is adjusted to the position of the end of the inserted text in the text editing page 420. It can be understood that the position of the end of the inserted text in the text editing page 420 also needs to be determined in combination with the sliding height when sliding the text displayed on the text editing page. For example, based on the recorded cursor position and the sliding height, the position of the cursor after sliding can be determined. Subsequently, based on the position of the cursor after sliding and the page height required to display the inserted text, the height position where the end of the inserted text is located can be determined.

[0059] In one embodiment, when adjusting the text displayed on the text editing page such that the adjusted displayed text includes inserted text, for example, the inserted text can also be simulated to be selected, facilitating the user to perform overall editing on the inserted text according to actual needs. Specifically, in this embodiment, first, based on the page height required to display the inserted text and the recorded cursor position information, the display position of the inserted text in the text editing page can be determined. That is, after determining the sliding of the text displayed on the text editing page, the position of the inserted text in the adjusted text editing page is determined. Subsequently, based on this display position, the inserted text is simulated to be selected. It can be understood that the principle of determining the position of the inserted text in the adjusted text editing page is similar to the principle of determining the position of the end of the inserted text in the text editing page 420, and will not be elaborated here.

[0060] It can be understood that when the second operation includes an operation of replacing text, the principle of adjusting the text displayed on the text editing page is similar to the adjustment principle when inserting text, and will not be elaborated here.

[0061] It can be understood that when the text length of the inserted text or the replaced text is relatively large and cannot be fully displayed in a single text editing page, the text displayed on the text editing page can be adjusted such that the adjusted displayed text includes as much of the inserted text or the replaced text as possible, and includes the content at the head or the tail of the inserted text or the replaced text.

[0062] Figure 5 It is a schematic diagram of adjusting the text editing page when the selected text is adjusted according to an embodiment of the present disclosure.

[0063] According to an embodiment of the present disclosure, the first operation on the displayed text may include, for example, an operation of adjusting the selected text, specifically, an operation of expanding or shrinking the selection area. Accordingly, the recorded interaction data may include the position information of the selected text in the text editing page.

[0064] Specifically, as Figure 5 shown, in this embodiment 500, the first operation may be an operation of expanding the selection area, that is, an operation of increasing the selected text "2. Determine your creative goal..." in the text editing page 510. As Figure 5 shown, in the process of adjusting the selected text in the related art, there is a situation where the text at the end of the selected text is not displayed in the text editing page 510. This situation is not conducive to the user to determine the selected text, and thus is not conducive to determining the termination point of the adjustment.

[0065] In the embodiment of the present disclosure, it is possible to first determine whether the text at the end of the currently selected text is at the bottom of the display area of the text according to the recorded position information of the selected text in the text editing page. If so, slide the text displayed in the text editing page to obtain a text editing page 520 as Figure 5 shown, so that the text at the end of the selected text is away from the bottom of the display area of the text. In this way, the situation where the text at the end of the selected text is not displayed in the text editing page 510 can be avoided.

[0066] For example, the position of the selected text can be compared with the position of the display area of the text in the text editing page, so as to determine whether the text at the end of the currently selected text is at the bottom of the display area of the text. When sliding the displayed text, the sliding height can be determined according to the format of the text, for example. For example, the sliding height can be the height occupied by the text of a predetermined number of lines. The predetermined number of lines can be one line, two lines or more lines, and the present disclosure does not limit this. The height occupied by the text of the predetermined number of lines can be determined according to the font size, line spacing, etc. in the text.

[0067] It can be understood that the position of the display area of the text in the text editing page can be determined according to, for example, the height occupied by other parts except the display area of the text in the text editing page. For example, as Figure 5 shown, the display area of the text is the area between the control area at the top of the text editing page and the control area at the bottom of the text editing page. In the case of displaying the virtual keyboard, the control area at the bottom of the text editing page becomes the area between the display area of the text and the virtual keyboard.

[0068] Figure 6 is a schematic diagram of the adjustment of the text editing page when the virtual keyboard is displayed according to an embodiment of the present disclosure.

[0069] According to an embodiment of the present disclosure, the first operation may be an operation of clicking on any position in the display area of the text. In response to the first operation, it may be determined that the user may need to insert text at any position or delete / modify the text before any position. Then, in response to the first operation, the virtual keyboard may be displayed on the text editing page.

[0070] As Figure 6 shown, in Embodiment 600, the first operation may be an operation of clicking on the position where the gesture in Figure 6 is located. In response to the first operation, the text editing page 610 may change to the text editing page 620, and the virtual keyboard is displayed in the text editing page 620.

[0071] After the virtual keyboard is displayed, any position clicked may be close to the bottom of the display area of the text or may be blocked by the virtual keyboard. This is not conducive to editing the text at any position. To avoid this situation, in the embodiment, while displaying the virtual keyboard, for example, according to the position information of the cursor in the text editing page and the height of the virtual keyboard, it may be determined whether the text content below the cursor in the text displayed after the virtual keyboard is displayed is less than a predetermined amount of text content. If it is less, while displaying the virtual keyboard, the text displayed in the text editing page is scrolled so that after the virtual keyboard is displayed, the text content below the cursor reaches the predetermined amount. Herein, the predetermined amount of text content may be, for example, the text content of a predetermined number of lines or the text content of a predetermined number of characters, and the present disclosure does not limit this. For example, in response to the first operation, the text editing page 610 may change to the text editing page 620, and the virtual keyboard is not only displayed in the text editing page 620, but also the text content below the cursor includes a predetermined amount (such as five lines) of text content. In this way, it is convenient for the user to edit the text at the cursor with reference to the text near the cursor, which is conducive to improving the editing efficiency and user experience.

[0072] Exemplarily, when determining whether the text content below the cursor in the text displayed after the virtual keyboard is shown is less than a predetermined amount of text content, for example, the display amount of the text content below the cursor in the text displayed after the virtual keyboard is shown can be determined first according to the text format information of the text, the height of the virtual keyboard, and the position information of the cursor. Subsequently, the display amount is compared with the predetermined amount. If the display amount is less than the predetermined amount, it can be determined that the text content below the cursor is less than the predetermined amount of text content. When sliding the displayed text, the sliding height can be determined according to the difference between the display amount and the predetermined amount. For example, the absolute value of the difference between the display amount and the predetermined amount can be used as the sliding height. Then, by sliding the text displayed in the text editing page according to the sliding height, the text content below the cursor in the text displayed after sliding can reach the predetermined amount. It can be understood that the text format information of the text can belong to the interaction data recorded in response to the first operation.

[0073] For example, when determining the display amount, the displayable height of the text, that is, the height of the display area of the text, can be determined first according to the height of the virtual keyboard. Specifically, the difference between the height of the text editing page and the height of the virtual keyboard can be used as the displayable height of the text. It can be understood that when there is also a control area set in the text editing page, the height of the control area can be subtracted from the height of the text editing page minus the height of the virtual keyboard to obtain the displayable height of the text. After obtaining the displayable height of the text, the display amount can be determined according to the displayable height, the position information of the cursor, and the text format information of the text. For example, the height position of the cursor in the display area of the text can be determined first through coordinate conversion according to the position information of the cursor. Subsequently, the difference between the displayable height of the text and the height of the cursor in the display area of the text is obtained to get the height of the area below the cursor in the display area of the text. Subsequently, according to the height of the area below the cursor and the text format information, the number of lines of the text below the cursor is determined, and this number of lines is used as the display amount. Among them, the text format information can include, for example, the font size and line spacing of the text, and the present disclosure does not limit this. Through this embodiment, the display amount can be accurately determined for different virtual keyboards, which is beneficial to improving the accuracy of the determined sliding height and further ensuring that the text editing page can display the predetermined amount of text below the cursor after sliding.

[0074] Figure 7 It is an implementation architecture diagram of a text editor for implementing a text editing method according to an embodiment of the present disclosure.

[0075] According to an embodiment of the present disclosure, the implementation architecture 700 of a text editor for implementing the text editing method provided by the present disclosure can be as Figure 7As shown. The text editor may include functions such as basic editing, complex editing, and intelligent editing, and the text editor implements complex editing and intelligent editing through data driving. It can be understood that the text editor can run in the form of an APP or in the form of a mini-program, and the present disclosure does not limit this.

[0076] The text editor may mainly consist of three parts. The first part is the page element, the second part is to receive user interactions and record interaction data according to user interactions, and the third part is to perform intelligent editing on the document.

[0077] The page elements may include a control bar (Top Bar) at the top, a selection area (which can be understood as the display area of the text), a quick control bar (Tip Bar), a control bar (Bottom Bar) at the bottom, and an interaction panel. Among them, the Top bar and BottomBar are used to quickly adjust the style and layout of the text content and can perform special identification on the selected text content. The TipBar can be displayed, for example, in response to a long press operation by the user on the selection area, and can be used to copy, polish, count the number of words, etc. of the selected text content. The interaction panel may include, for example, a virtual keyboard for inputting, modifying, or deleting text content, etc. It can be understood that some page elements can be adjusted, for example, in response to user interactions.

[0078] The received user interactions may include, for example, user clicks on the text editing page (i.e., interactions for positioning (focusing) the cursor), user selections of text content (including interactions for expanding and shrinking the selection area of the text), interactions for inputting text content, interactions for deleting text content, long presses on the text editing page, interactions for adjusting the style or layout of the text content (such as interactions for editing text format and paragraph format), etc. After receiving the user interaction, the text editor can record the interaction data corresponding to the user interaction, and the interaction data can reflect the current interaction situation. For example, it can include the position information of the cursor, information on whether the cursor is at the start or end position of a paragraph, information on whether text content is currently selected and the position of the selected text content, and the layout type of the selected text (such as text format and paragraph format, etc.). By responding to the interaction and recording the interaction data, control over the display of page elements can be achieved, and subsequent content presentation and intelligent editing can be realized.

[0079] The intelligent editing function may include, for example, a simulated selection function, a function for automatically sliding and displaying text, display panels (such as Tip Bar, virtual keyboard, etc.), and an AI editing function.

[0080] For example, based on the intelligent editing function, the text editor can flexibly adjust the text content displayed in the text display area according to the height of the virtual keyboard, the height of the Bottom Bar, the height of the Top Bar, and the cursor position, so that the end part of the selected text can be fully displayed. Based on the intelligent editing function, when the user selects text content and expands or shrinks the selection area, the text editor can calculate the visible area of the text on the page according to the current cursor position and page elements, and slide the text displayed in the text display area, so that the user can see the changes in the selected area in real time.

[0081] For example, based on the intelligent editing function, when the user operates on an area outside the text display area, the text editor can simulate the selection of the text content previously selected by the user according to the existing interaction data, so as to avoid the situation where the text display area loses focus, so that the user can see the text content being edited in real time.

[0082] For example, based on the intelligent editing function, when inserting text content through intelligent editing, the text editor can adjust the text displayed in the text display area and automatically simulate the selection of the inserted text. For example, if only the cursor is positioned before inserting text, and the inserted text is generated using the AI editing function, then the newly generated inserted text is simulated as being selected. If part of the text content is selected before inserting text, and then the inserted text is generated using the AI editing function, the selected text content will be replaced with the inserted text, and the inserted text will be simulated as being selected. At the same time, it is possible to automatically determine the text display area according to the position of the cursor, the height of the inserted text, and the height of other areas on the page except the text display area, and slide the text displayed in the text display area to scroll the top or bottom of the simulated selected content into the text display area, so that the user can perceive the change result of the content.

[0083] It can be understood that when the user positions the cursor in the text display area, the system of the mobile terminal can automatically bring up the keyboard (such as a certain input method), and the text editor can obtain the height of the keyboard by subtracting the height of the page from the screen height. The text editor can sense the switching of the keyboard by monitoring the height of the page. It can be understood that the page here refers to the page formed by other parts of the page displayed on the display screen of the mobile terminal except the keyboard, and the page displayed on the display screen can be understood as the text editing page described above.

[0084] Based on the text editing method provided by the present disclosure, the present disclosure also provides a text editing device. The following will be combined with Figure 8 This device will be described in detail.

[0085] Figure 8 Structural block diagram of the text editing device according to an embodiment of the present disclosure.

[0086] As shown Figure 8 in the figure, the text editing device 800 according to an embodiment of the present disclosure may include a data recording module 810 and a page adjustment module 820.

[0087] The data recording module 810 is configured to record interaction data corresponding to the first operation in response to the first operation on the text displayed in the text editing page. Wherein, the text editing page is a display page of a text editor. The text editor is constructed using a target technology that supports cross-platform use of the text editor. In one embodiment, the data recording module 810 may be used to perform the operation S210 described above, which will not be elaborated herein.

[0088] The page adjustment module 820 is configured to adjust the text displayed in the text editing page according to the interaction data. In one embodiment, the page adjustment module 820 may be used to perform the operation S220 described above, which will not be elaborated herein.

[0089] According to an embodiment of the present disclosure, the above-mentioned page adjustment module 820 may specifically be configured to: in response to a second operation on a target element in the text editing page after the first operation, adjust the text displayed in the text editing page according to the interaction data. Wherein, the target element is an element for editing the displayed text.

[0090] According to an embodiment of the present disclosure, the above-mentioned first operation includes an operation of selecting at least part of the text. The above-mentioned page adjustment module 820 may include: a text position determination sub-module, configured to determine first position information of the at least part of the selected text in the text editing page according to the interaction data; and a first selection sub-module, configured to simulate selecting the at least part of the text according to the first position information.

[0091] According to an embodiment of the present disclosure, the above-mentioned second operation includes an operation of inserting text or replacing text, and the above-mentioned interaction data includes second position information of the cursor in the text editing page. The above-mentioned page adjustment module 820 may include: a page height determination sub-module, configured to determine the page height required to display any text in the text editing page; and a page adjustment sub-module, configured to adjust the text displayed in the text editing page according to the page height and the second position information, so that the adjusted displayed text includes any text.

[0092] According to an embodiment of the present disclosure, the above-mentioned page adjustment module 820 may further include a cursor position adjustment sub-module, configured to adjust the position of the cursor in the text editing page according to the page height and the second position information, so that the cursor is located at the start position or the end position of any text.

[0093] According to an embodiment of the present disclosure, the above-mentioned page adjustment module 820 may further include: a display position determination sub-module, configured to determine the display position of any text in the text editing page according to the page height and the second position information; and a second selection sub-module, configured to simulate selecting any text in the text editing page according to the display position.

[0094] According to an embodiment of the present disclosure, the above-mentioned page adjustment sub-module may include: a sliding height determination unit, configured to determine a first sliding height required to display any text according to the page height and the second position information; and a sliding unit, configured to slide the text displayed in the text editing page according to the first sliding height and insert any text into the text after sliding.

[0095] According to an embodiment of the present disclosure, the above-mentioned first operation includes an operation of adjusting the selected text, and the above-mentioned interaction data includes third position information of the selected text in the text editing page. Specifically, the page adjustment module 820 may be configured to, in response to determining that the text at the end in the currently selected text is located at the bottom of the text display area according to the third position information, slide the text displayed in the text editing page, so that the text at the end is away from the bottom of the text display area.

[0096] According to an embodiment of the present disclosure, the above-mentioned first operation includes an operation of clicking any position in the display area of the text, and the above-mentioned interaction data includes second position information of the cursor in the text editing page. The above-mentioned text editing device may further include a display module, configured to display a virtual keyboard in the text editing page in response to the first operation. In this embodiment, specifically, the page adjustment module 820 may be configured to, in response to determining that the text content below the cursor in the text displayed after displaying the virtual keyboard is less than a predetermined amount according to the second position information and the height of the virtual keyboard, slide the text displayed in the text editing page, so that the text content below the cursor reaches the predetermined amount.

[0097] According to an embodiment of the present disclosure, the above interaction data further includes the text format information of the text. The above page adjustment module 820 may include: a display amount determination sub-module, configured to determine the display amount of the text content located below the cursor in the text displayed after the virtual keyboard is displayed according to the text format information of the text, the height of the virtual keyboard, and the second position information; a sliding height determination sub-module, configured to determine the second sliding height of the text displayed in the text editing page according to the text format information of the text and the difference between the display amount and the predetermined amount; and a sliding sub-module, configured to slide the text displayed in the text editing page according to the second sliding height.

[0098] According to an embodiment of the present disclosure, the above display amount determination sub-module may include: a display height determination unit, configured to determine the displayable height of the text according to the height of the virtual keyboard; and a display amount determination unit, configured to determine the display amount of the text content located below the cursor in the text displayed after the virtual keyboard is displayed according to the displayable height, the second position information, and the text format information of the text.

[0099] According to an embodiment of the present disclosure, the above first operation includes an operation of clicking on the start position or the end position of any text paragraph in the displayed text, the above interaction data includes the second position information of the cursor in the text editing page and the relative position information between the cursor and the text paragraph in the displayed text, and the above second operation includes an operation of changing the paragraph format. The above text adjustment module may include: a paragraph position determination sub-module, configured to determine the fourth position information of the target paragraph whose paragraph format needs to be changed in the text editing page according to the second position information and the relative position information; a third selection sub-module, configured to simulate the selection of the target paragraph according to the fourth position information; and a format adjustment sub-module, configured to adjust the paragraph format of the target paragraph according to the paragraph format determined by the second operation.

[0100] According to an embodiment of the present disclosure, the above target technology may include HTML5 technology.

[0101] It should be noted that in the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure, and application, etc. of the user's personal information involved all comply with the provisions of relevant laws and regulations, necessary confidentiality measures are taken, and it does not violate public order and good customs. In the technical solution of the present disclosure, before obtaining or collecting the user's personal information, the authorization or consent of the user is obtained.

[0102] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0103] Figure 9FIG. 0 shows a schematic block diagram of an exemplary electronic device 900 that can be used to implement the text editing method according to embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as, for example, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as, for example, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely exemplary and are not intended to limit the implementations of the present disclosure described and / or claimed herein.

[0104] As Figure 9 shown, the device 900 includes a computing unit 901 that can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0105] A plurality of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a magnetic disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0106] The computing unit 901 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 executes the various methods and processes described above, such as the text editing method. For example, in some embodiments, the text editing method can be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the text editing method described above can be executed. Alternatively, in other embodiments, the computing unit 901 can be configured to execute the text editing method in any other suitable way (e.g., by means of firmware).

[0107] Various embodiments of the systems and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems on a chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.

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

[0109] In the context of this disclosure, a machine-readable medium can be a tangible medium that can contain or store 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. The machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, 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 diskette, 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.

[0110] In order to provide interaction with a user, the systems and techniques described herein 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 also be used to provide interaction with the user; for example, the 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 input, voice input, or tactile input).

[0111] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend 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.

[0112] A computer system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The relationship between the client and the server is created by computer programs running on respective computers and having a client-server relationship with each other. Among them, the server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services (″Virtual Private Server″, or simply ″VPS″). The server may also be a server of a distributed system or a server combined with a blockchain.

[0113] It should be understood that various forms of processes shown above can be used, steps can be reordered, added or deleted. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitation is imposed herein.

[0114] The above specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the protection scope of this disclosure.

Claims

1. A text editing method, comprising: responding to a first operation on the text displayed in the text editing page, recording interaction data corresponding to the first operation, wherein the interaction data includes the position information of the touch point of the first operation in the text editing page; the text editing page is the display page of a text editor; and responding to a second operation on a target element in the text editing page after the first operation, adjusting the text displayed in the text editing page according to the interaction data, wherein the target element is an element for editing the displayed text; wherein the text editor is constructed using a target technology, and the target technology supports cross-platform use of the text editor; wherein adjusting the text displayed in the text editing page according to the interaction data includes: determining whether the text to be edited by the user is completely displayed according to the interaction data, wherein the text to be edited by the user includes the context of a predetermined range of the text corresponding to the cursor position; if not completely displayed, determining whether the text to be edited can be located in the displayed page according to the interaction data and subsequent operations on the text editing page; if unable to locate, locating the text to be edited by simulating selection of the text to be edited; and responding to locating the text to be edited, adjusting the text displayed in the text editing page so that the text to be edited is completely displayed.

2. The method according to claim 1, wherein The first operation includes an operation of selecting at least part of the text; Adjusting the text displayed in the text editing page according to the interaction data includes: determining the first position information of the at least part of the selected text in the text editing page according to the interaction data; and simulating selection of the at least part of the text according to the first position information.

3. The method according to claim 1, wherein, The second operation includes an operation of inserting text or an operation of replacing text; the interaction data includes the second position information of the cursor in the text editing page; For any one of the inserted text and the replaced text, adjusting the text displayed in the text editing page according to the interaction data includes: determining the page height required to display the any one of the text in the text editing page; and adjusting the text displayed in the text editing page according to the page height and the second position information so that the adjusted displayed text includes the any one of the text.

4. The method according to claim 3, wherein, Adjusting the text displayed in the text editing page according to the interaction data further includes: adjusting the position of the cursor in the text editing page according to the page height and the second position information so that the cursor is located at the start position or the end position of the any one of the text.

5. The method according to claim 3, wherein Adjusting the text displayed in the text editing page according to the interaction data further includes: determining the display position of the any one of the text in the text editing page according to the page height and the second position information; and simulating selection of the any one of the text in the text editing page according to the display position.

6. The method according to claim 3, wherein Adjusting the text displayed in the text editing page according to the page height and the second position information so that the adjusted displayed text includes any of the texts includes: Determining a first sliding height required to display any of the texts according to the page height and the second position information; and Sliding the text displayed in the text editing page according to the first sliding height and inserting any of the texts into the text after sliding.

7. The method according to claim 1, wherein The first operation includes an operation of adjusting the selected text; the interaction data includes third position information of the selected text in the text editing page; Adjusting the text displayed in the text editing page according to the interaction data includes: In response to determining that the text at the end of the currently selected text is at the bottom of the text display area according to the third position information, sliding the text displayed in the text editing page so that the text at the end is away from the bottom of the text display area.

8. The method according to claim 1, wherein, The first operation includes an operation of clicking any position in the text display area; the interaction data includes second position information of the cursor in the text editing page; The method further includes: in response to the first operation, displaying a virtual keyboard in the text editing page; Adjusting the text displayed in the text editing page according to the interaction data includes: In response to determining that the text content below the cursor in the text displayed after displaying the virtual keyboard is less than a predetermined amount according to the second position information and the height of the virtual keyboard, sliding the text displayed in the text editing page so that the text content below the cursor reaches the predetermined amount.

9. The method according to claim 8, wherein The interaction data further includes text format information of the text; sliding the text displayed in the text editing page so that the text content below the cursor reaches the predetermined amount includes: Determining the display amount of the text content below the cursor in the text displayed after displaying the virtual keyboard according to the text format information of the text, the height of the virtual keyboard, and the second position information; Determining a second sliding height of the text displayed in the text editing page according to the text format information of the text and the difference between the display amount and the predetermined amount; and Sliding the text displayed in the text editing page according to the second sliding height.

10. The method according to claim 9, wherein Determining the display amount of the text content below the cursor in the displayed text includes: Determining the displayable height of the text according to the height of the virtual keyboard; and Determining the display amount of the text content below the cursor in the text displayed after displaying the virtual keyboard according to the displayable height, the second position information, and the text format information of the text.

11. The method according to claim 1, wherein, The first operation includes an operation of clicking the start position or the end position of any text paragraph in the displayed text; the interaction data includes second position information of the cursor in the text editing page and relative position information between the cursor and the text paragraph in the displayed text; The second operation includes an operation of changing the paragraph format; Adjusting the text displayed on the text editing page according to the interaction data includes: Determining fourth position information of a target paragraph whose paragraph format needs to be changed in the text editing page according to the second position information and the relative position information; Simulating selection of the target paragraph according to the fourth position information; and Adjusting the paragraph format of the target paragraph according to the paragraph format determined by the second operation.

12. The method according to claim 1, wherein, The target technology includes HTML5 technology.

13. A text editing device, comprising: A data recording module, configured to record interaction data corresponding to a first operation on text displayed on a text editing page, where the interaction data includes position information of a touch point of the first operation on the text editing page; the text editing page is a display page of a text editor; and A page adjustment module, configured to adjust the text displayed on the text editing page according to the interaction data in response to a second operation on a target element in the text editing page after the first operation, where the target element is an element for editing the displayed text; wherein the text editor is built using a target technology, and the target technology supports cross-platform use of the text editor; wherein the page adjustment module is further configured to determine whether the text to be edited by the user is completely displayed according to the interaction data, where the text to be edited by the user includes the context of a predetermined range of the text corresponding to the cursor position; if not completely displayed, determine whether the text to be edited can be located in the displayed page according to the interaction data and subsequent operations on the text editing page; if it cannot be located, locate the text to be edited by simulating selection of the text to be edited; and in response to locating the text to be edited, adjust the text displayed on the text editing page so that the text to be edited is completely displayed.

14. The device according to claim 13, wherein, The first operation includes an operation of selecting at least part of the text; The page adjustment module includes: A text position determination sub-module, configured to determine first position information of the at least part of the text selected in the text editing page according to the interaction data; and A first selection sub-module, configured to simulate selection of the at least part of the text according to the first position information.

15. The device according to claim 13, wherein The second operation includes an operation of inserting text or an operation of replacing text; the interaction data includes second position information of the cursor in the text editing page; The page adjustment module includes: A page height determination sub-module, configured to determine the page height required to display any text in the text editing page; and A page adjustment sub-module, configured to adjust the text displayed on the text editing page according to the page height and the second position information so that the adjusted displayed text includes the any text.

16. The apparatus according to claim 15, wherein, The page adjustment module further includes: A cursor position adjustment sub-module, configured to adjust the position of the cursor in the text editing page according to the page height and the second position information, so that the cursor is located at the start position or the end position of any text.

17. The apparatus according to claim 15, wherein The page adjustment module further includes: A display position determination sub-module, configured to determine the display position of any text in the text editing page according to the page height and the second position information; and A second selection sub-module, configured to simulate the selection of any text in the text editing page according to the display position.

18. The apparatus according to claim 15, wherein The page adjustment sub-module includes: A sliding height determination unit, configured to determine a first sliding height required to display any text according to the page height and the second position information; and A sliding unit, configured to slide the text displayed in the text editing page according to the first sliding height and insert any text into the text after sliding.

19. The apparatus according to claim 13, wherein, The first operation includes an operation of adjusting the selected text; the interaction data includes third position information of the selected text in the text editing page; the page adjustment module is configured to: In response to determining that the text at the end in the currently selected text is at the bottom of the display area of the text according to the third position information, slide the text displayed in the text editing page so that the text at the end is away from the bottom of the display area of the text.

20. The apparatus according to claim 13, wherein, The first operation includes an operation of clicking any position in the display area of the text; the interaction data includes second position information of the cursor in the text editing page; The device further includes a display module, configured to display a virtual keyboard in the text editing page in response to the first operation; The page adjustment module is configured to: in response to determining, according to the second position information and the height of the virtual keyboard, that the amount of text content below the cursor in the text displayed after the virtual keyboard is displayed is less than a predetermined amount, slide the text displayed in the text editing page so that the text content below the cursor reaches the predetermined amount.

21. The apparatus according to claim 20, wherein The interaction data further includes text format information of the text; The page adjustment module includes: A display amount determination sub-module, configured to determine the display amount of the text content below the cursor in the text displayed after the virtual keyboard is displayed according to the text format information of the text, the height of the virtual keyboard, and the second position information; A sliding height determination sub-module, configured to determine a second sliding height of the text displayed in the text editing page according to the text format information of the text and the difference between the display amount and the predetermined amount; and A sliding sub-module, configured to slide the text displayed in the text editing page according to the second sliding height.

22. The device according to claim 21, wherein, The display amount determination sub-module includes: A display height determination unit, configured to determine the displayable height of the text according to the height of the virtual keyboard; and A display amount determination unit, configured to determine the display amount of the text content below the cursor in the text displayed after the virtual keyboard is displayed according to the displayable height, the second position information, and the text format information of the text.

23. The device according to claim 13, wherein, The first operation includes an operation of clicking on the starting position or the ending position of any text paragraph in the displayed text; the interaction data includes second position information of the cursor in the text editing page and relative position information between the cursor and the text paragraphs in the displayed text; The second operation includes an operation of changing the paragraph format; the text adjustment module includes: a paragraph position determination sub-module, configured to determine fourth position information of a target paragraph whose paragraph format needs to be changed in the text editing page according to the second position information and the relative position information; a third selection sub-module, configured to simulate selection of the target paragraph according to the fourth position information; and a format adjustment sub-module, configured to adjust the paragraph format of the target paragraph according to the paragraph format determined by the second operation.

24. The apparatus according to claim 13, wherein, The target technology includes HTML5 technology.

25. 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, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the method according to any one of claims 1 to 12.

26. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 12.

27. A computer program product, comprising computer programs / instructions stored on at least one of a readable storage medium and an electronic device, and when the computer programs / instructions are executed by a processor, steps of the method according to any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

  • Interaction method and device of content processing tool, equipment and storage medium

    CN116841437A