CN114138717A - Rich text information publishing method and related device - Google Patents

Rich text information publishing method and related device Download PDF

Info

Publication number
CN114138717A
CN114138717A CN202111461482.7A CN202111461482A CN114138717A CN 114138717 A CN114138717 A CN 114138717A CN 202111461482 A CN202111461482 A CN 202111461482A CN 114138717 A CN114138717 A CN 114138717A
Authority
CN
China
Prior art keywords
rich text
information
text information
function
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111461482.7A
Other languages
Chinese (zh)
Inventor
杨羽琛
郝学宇
彭慧琴
廖春晓
刘超
吴曦
唐攀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202111461482.7A priority Critical patent/CN114138717A/en
Publication of CN114138717A publication Critical patent/CN114138717A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application provides a method and a related device for releasing rich text information, and relates to the technical field of data processing. Further, the rich text information to be sent is wrapped by a container and sent to the target address. The container defines a presentation style of the rich text information. When reading the rich text information, different platforms can read the defined display style in the container in advance, and then display the rich text information according to the display style. Therefore, the rich text information can be displayed in the same display style on different platforms, and the problem of cross-platform incompatibility of the rich text information is solved.

Description

Rich text information publishing method and related device
Technical Field
The present invention relates to the field of data processing, and in particular, to a method and a related apparatus for publishing rich text information.
Background
With the development of social informatization, information publishing has become a daily behavior in work. The information to be published can be divided into two specifications of plain text and rich text from the text perspective. Plain text only supports the labeling of words and common punctuation. The rich text information is rendered and calculated at a higher layer on the basis of the plain text, and has the capability of supporting the editing of pictures, special punctuations and segmented formats.
Different rich text editors set different styles of rich text information, and different reading modes of different platforms exist. When the platform does not support style reading of rich text information, the rich text information cannot be opened by the platform. For example, a partially rich text message may be opened on the apple leopard operating system (macintosh, Ios) but not on the Windows operating system (Microsoft Windows, Windows). Therefore, the traditional rich text publishing often causes the problem of incompatibility of rich text information across platforms.
Disclosure of Invention
The embodiment of the application provides a method and a related device for releasing rich text information, wherein the rich text information is wrapped in a container so that different platforms need to display the rich text information according to a display style defined by the container when reading the rich text information, and the problem of cross-platform incompatibility of the rich text information is avoided.
In a first aspect, an embodiment of the present application provides a method for publishing rich text information, where the method includes:
responding to the indication of finishing editing, and acquiring rich text information to be sent;
detecting preset sensitive information in the rich text information, and performing escape processing on the detected preset sensitive information, wherein the preset sensitive information is information with a cross-site scripting XSS function;
carrying out container wrapping on the rich text information, and sending information to be sent to a target address; the container is used for defining the display style of the rich text information, and the information to be sent is the rich text information wrapped by the container.
The method and the device for detecting the XSS of the rich text message reduce the risk that the platform is attacked by the XSS by detecting whether the rich text message has the preset sensitive information or not and conducting escape processing on the detected preset sensitive information. Further, the rich text information to be sent is wrapped by a container and sent to the target address. Because the container defines the display style of the rich text information, the rich text information needs to be displayed according to the display style defined by the container when different platforms read the rich text information, and the problem of cross-platform incompatibility of the rich text information is avoided.
In some possible embodiments, before obtaining the rich text information to be sent, the method further includes:
receiving configuration information imported by a user;
determining a target function selected by a user from a function cluster for information editing according to the configuration information;
controlling an editing end to display a function control of the target function so that a user can edit rich text information based on the function control; and the user executes the function corresponding to the function control by controlling the function control, and each function control is bound with at least one function in the function cluster.
The rich text editing end provided by the embodiment of the application can support configuration import of a user. The imported configuration information is used for indicating the target function selected by the user, the function control corresponding to the target function selected by the user can be displayed at the editing end by importing the configuration information, and then the user can execute the function corresponding to the function control by controlling the function control, so that the user-defined display of the rich text editing function is realized.
In some possible embodiments, the method further comprises:
responding to a user-defined instruction of a function control, and acquiring the function control to be modified and a user-defined function set corresponding to the function control to be modified from the user-defined instruction; wherein the custom function set comprises at least one function in the function cluster;
and modifying the function control based on the user-defined function set so that each function in the user-defined function set is bound to the modified function control.
The method and the device support the user to edit the function control in a user-defined mode, and after the user-defined indication of the function control is received, the function control to be modified and the user-defined function set corresponding to the function control are obtained from the indication. The user-defined function set is a subset of the function cluster, the function control is modified based on the user-defined function set, and all functions of the user-defined function set are bound to the modified function control, so that customized setting of the functions by a user is realized.
In some possible embodiments, before sending the information to be sent to the target address, the method further includes:
acquiring a target address indicated by the rich text information;
and processing the wrapped rich text information through a lossless data compression algorithm, and taking a compressed file obtained through processing as the information to be sent.
In the embodiment of the application, in order to solve the problem that rich text information contains a large amount of pictures and format information, the data size is large, and the network transmission efficiency is affected, before the information to be sent is sent to the target address, the target address to be sent needs to be obtained from the rich text information, and the rich text information after the container is wrapped is compressed through a lossless data compression algorithm.
In some possible embodiments, the escaping processing of the detected preset sensitive information includes:
and adding appointed escape tags to the preset sensitive information, wherein each appointed escape tag corresponds to at least one preset sensitive information.
When XSS detection is executed, the preset sensitive information can still be normally displayed by setting the appointed escape tag for the preset sensitive information, and XSS risks are avoided.
In some possible embodiments, the method further comprises:
storing the rich text information after XSS detection;
the method further comprises the following steps:
responding to a re-editing instruction of the rich text information, and acquiring a storage path of the rich text information;
and calling rich text information corresponding to the storage path from a storage space, and sending the rich text information to an editing end so that a user can perform re-editing operation on the rich text information.
According to the method and the device for storing the rich text information, the rich text information after XSS detection is stored, and when a user has a re-editing requirement on the edited rich text information, the rich text information can be called from a storage space by sending a re-editing instruction and can be edited again at an editing end.
In a second aspect, an embodiment of the present application provides a device for issuing rich text information, where the device includes:
the information acquisition module is configured to execute responding to the indication of editing completion and acquire rich text information to be sent;
the script detection module is configured to detect preset sensitive information in the rich text information and perform escape processing on the detected preset sensitive information, wherein the preset sensitive information is information with a cross-site script attack XSS function;
the information sending module is configured to perform container wrapping on the rich text information and send information to be sent to a target address; the container is used for defining the display style of the rich text information, and the information to be sent is the rich text information wrapped by the container.
In some possible embodiments, before performing the acquiring rich text information to be transmitted, the information acquisition module is further configured to:
receiving configuration information imported by a user;
determining a target function selected by a user from a function cluster for information editing according to the configuration information;
controlling an editing end to display a function control of the target function so that a user can edit rich text information based on the function control; and the user executes the function corresponding to the function control by controlling the function control, and each function control is bound with at least one function in the function cluster.
In some possible embodiments, the information acquisition module is further configured to:
responding to a user-defined instruction of a function control, and acquiring the function control to be modified and a user-defined function set corresponding to the function control to be modified from the user-defined instruction; wherein the custom function set comprises at least one function in the function cluster;
and modifying the function control based on the user-defined function set so that each function in the user-defined function set is bound to the modified function control.
In some possible embodiments, before performing the sending of the information to be sent to the target address, the information sending module is further configured to:
acquiring a target address indicated by the rich text information;
and processing the wrapped rich text information through a lossless data compression algorithm, and taking a compressed file obtained through processing as the information to be sent.
In some possible embodiments, the escaping processing of the detected preset sensitive information is performed, and the script detection module is configured to:
and adding appointed escape tags to the preset sensitive information, wherein each appointed escape tag corresponds to at least one preset sensitive information.
In some possible embodiments, the information sending module is further configured to:
storing the rich text information after XSS detection;
the information sending module is further configured to:
responding to a re-editing instruction of the rich text information, and acquiring a storage path of the rich text information;
and calling rich text information corresponding to the storage path from a storage space, and sending the rich text information to an editing end so that a user can perform re-editing operation on the rich text information.
In a third aspect, an embodiment of the present application further provides an electronic device, including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement any of the methods as provided in the first aspect of the application.
In a fourth aspect, embodiments of the present application further provide a computer-readable storage medium, where instructions, when executed by a processor of an electronic device, enable the electronic device to perform any one of the methods as provided in the first aspect of the present application.
In a fifth aspect, an embodiment of the present application provides a computer program product comprising a computer program that, when executed by a processor, implements any of the methods as provided in the first aspect of the present application.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a diagram of an application scenario shown in an embodiment of the present application;
fig. 2a is an overall flowchart of a method for publishing rich text information according to an embodiment of the present application;
FIG. 2b is a schematic diagram of a custom presentation functionality control shown in an embodiment of the present application;
FIG. 2c is a schematic diagram of a custom function shown in an embodiment of the present application;
fig. 2d is a schematic diagram of a function control corresponding to a custom function according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a system architecture according to an embodiment of the present application;
fig. 4 is a block diagram of a rich text information distribution apparatus 400 according to an embodiment of the present application;
fig. 5 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described in detail and clearly with reference to the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, "a face will mean or means, for example, a/B may mean a or B; "and/or" in the text is only an association relationship describing an associated object, and means that three relationships may exist, for example, a and/or B may mean: three cases of a alone, a and B both, and B alone exist, and in addition, "a plurality" means two or more than two in the description of the embodiments of the present application.
In the description of the embodiments of the present application, the term "plurality" means two or more unless otherwise specified, and other terms and the like should be understood similarly, and the preferred embodiments described herein are only for the purpose of illustrating and explaining the present application, and are not intended to limit the present application, and features in the embodiments and examples of the present application may be combined with each other without conflict.
To further illustrate the technical solutions provided by the embodiments of the present application, the following detailed description is made with reference to the accompanying drawings and the detailed description. Although the embodiments of the present application provide method steps as shown in the following embodiments or figures, more or fewer steps may be included in the method based on conventional or non-inventive efforts. In steps where no necessary causal relationship exists logically, the order of execution of the steps is not limited to that provided by the embodiments of the present application. The method can be executed in the order of the embodiments or the method shown in the drawings or in parallel in the actual process or the control device.
As mentioned above, the rich text editing end sets the style of the rich text information differently, and there is a difference in the reading manner of different platforms. When the platform does not support style reading of rich text information, the rich text information cannot be opened by the platform. Specifically, for example, common Office software Microsoft Office Word has a function of editing rich text information, and can be regarded as a rich text editing end. The partial version of the software does not support reading in an IOS system of the apple and only supports reading of windows, so that the problem of cross-platform incompatibility of rich text information is solved, and user experience is influenced.
In order to solve the above problems, the inventive concept of the present application is: XSS detection is carried out on the edited rich text information in advance, whether preset sensitive information exists in the rich text information is detected, and escape processing is carried out on the detected preset sensitive information so as to reduce the risk that the platform is attacked by XSS. Further, the rich text information to be sent is wrapped by a container and sent to the target address. The container defines a presentation style of the rich text information. When reading the rich text information, different platforms can read the defined display style in the container in advance, and then display the rich text information according to the display style. Therefore, the rich text information can be displayed in the same display style on different platforms, and the problem of cross-platform incompatibility of the rich text information is solved.
Referring to fig. 1, a schematic diagram of an application environment according to an embodiment of the present application is shown.
As shown in fig. 1, the application environment may include, for example, a network 10, an electronic device 20, a service 30, and a database 40. The electronic device 20 may be a smart device having a text message sending function, such as the smart phone 20_1, the smart computer 20_2, and the notebook computer 20_ n shown in fig. 1.
The electronic device 20 includes a rich text message editor that provides editing and presentation functions for rich text messages. The rich text information editor is used for editing and displaying rich text information. The user may send the edited rich text message to its destination address via network 10. The rich text editor is common rich text editing software in the market, such as common Office software Microsoft Office Word, WPS Office, and the like.
In some possible embodiments, after the user finishes editing the rich text information through the electronic device 20, the edited rich text information is sent to the server 30. The server 30 stores the received rich text information in the database 40.
After introducing the application scenario of the embodiment of the present application, a detailed description is given below to a method for publishing rich text information provided by the embodiment of the present application with reference to the drawings. As shown in fig. 2a, the method comprises the following steps:
step 201: responding to the indication of finishing editing, and acquiring rich text information to be sent;
as mentioned above, the rich text message editor has the capability of editing and displaying the rich text message. In particular, the rich text editor may provide a user with an editing interface, such as in common office software or applications with rich text message editing capabilities, for editing rich text messages. The interface displays functions such as changing font color, thickening font, adding underlines, adding subscripts, drawing cuboids and the like, and the functions jointly form a function cluster for editing rich text information, and the function clusters are edited in the development stage.
Considering that a user only needs several commonly used functions when editing information, the embodiment of the application supports the user to configure the rich text information editing function in a customized manner. Therefore, before editing the rich text information, the user can add the selected target function to the configuration information in a mode of importing the configuration information.
During implementation, configuration information imported by a user is received, and a target function selected by the user is determined from the function cluster for information editing according to the configuration information. And then controlling the editing end to display the function control of the target function so that the user edits the rich text information based on the function control. And the user executes the functions corresponding to the function controls by controlling the function controls, and each function control is bound with at least one function in the function cluster.
Specifically, in the embodiment of the present application, a configuration file config is set under a specified directory of a rich text editor. The file can be opened by a plain text editor, and a user can configure required configuration content in the file. For example, a configuration item toolbar is preset, and a user can add a selected function in the item. Specifically, as shown in fig. 2b, for example, if the user sets 6 functions of "bold", "italic", "underline", "strikethrough", "font size", and "picture insertion" in the tobar, only the 6 functions are imported into the function bar at the editing end. Correspondingly, if the user does not import the configuration information, all functions of the function cluster required by the user are defaulted, and all functions of the function cluster are imported into the function bar of the editing end at the moment.
In order to further improve the user-defined configuration requirement, the embodiment of the application also supports the user-defined editing of the function control. In implementation, in response to the user-defined indication of the function control, the function control to be modified and the user-defined function set corresponding to the function control to be modified are obtained from the user-defined indication. And modifying the function control based on the user-defined function set so that the modified function control is bound with each function in the user-defined function set. The realization of the function requires that a user has certain coding capacity, and the function requires the user to self-code to realize the function. For example "image" as shown in fig. 2b, whose default function is to insert a picture. If the user feels that the inserted picture cannot meet the requirement, the function is modified to be inserted into the video. At this time, as shown in fig. 2c, the user needs to add a function () function for "image" in config. The function () function is a code implementation for adding a custom function, i.e., the above-described code logic for inserting video.
Furthermore, the user-defined configuration can also realize the integration of the user-defined function in the functional cluster. For example, if the user needs to use the function of the "rectangular parallelepiped development" at the same time as the "rectangular parallelepiped" function, the function of drawing the rectangular parallelepiped and the rectangular parallelepiped development can be added to the function () of the "rectangular parallelepiped" or the "rectangular parallelepiped development" by the above method. Specifically, as shown in fig. 2d, the default "cuboid" function only supports drawing a cuboid, and the function of drawing a cuboid and a cuboid development diagram is added to the function () of "cuboid". At the moment, two functions of drawing the cuboid and the cuboid unfolded drawing can be started by clicking the functional control (namely the icon) of the cuboid.
In addition, the realization of the functions needs a certain coding capacity of the user and has limitation. In order to solve the above problem, a code of a commonly used custom function may be transmitted to the user in a manner similar to notification information such as a user manual. Therefore, the user can realize the configuration of the custom function only by simply pasting.
Step 202: detecting preset sensitive information in the rich text information, and performing escape processing on the detected preset sensitive information, wherein the preset sensitive information is information with a cross-site scripting XSS function;
consider that many existing rich text editors do not have the capability to detect and defend against Cross-site scripting (Cross SiteScript, XSS). According to the method and the device, common attack codes of XSS attacks are set as the preset sensitive information, after the rich text information is edited by a user, the rich text information is detected, and if the preset sensitive information is detected to exist, the preset sensitive information is subjected to escaping processing. The preset sensitive information after the escape processing can still be normally displayed, but does not have XSS attack capability.
For example, the text content in the rich text message is "want to desphish < script > function del () { … … } </script >". After the rich text information is stored in the background, if other users read the rich text information, if the rich text information is opened in the browser, the content in the < script > tag is parsed into a program to be executed, and the program can perform some risky operations, such as reading the user information and sending the user information to others. Therefore, when the user edits information in the rich text, if the user inputs the < script > information, it should be ensured that the original content including the < script > tag is displayed instead of the < script > being executed as a program when the rich text information is displayed, so that the content like < script > is the preset sensitive information, and a specified escape tag can be added to the preset sensitive information. Wherein each designated escape tag corresponds to at least one preset sensitive information. Specifically, "<" in < script > may be escape to "& lt", ">" may be escape to "& lg", and "/" may be escape to "& # x 2F".
Step 203: carrying out container wrapping on the rich text information, and sending information to be sent to a target address; the container is used for defining the display style of the rich text information, and the information to be sent is the rich text information wrapped by the container.
Different rich text editors set different styles of rich text information, and different reading modes of different platforms exist. At this time, the style set for the font of the rich text information may not be normally displayed, and the information such as the default font size, color, and font of the display ends such as a computer, a mobile phone, a tablet and the like is different, which causes the display contents of the same rich text information at different display ends to be different.
In order to solve the problem, the embodiment of the application adopts a containerization technology, and the rich text information after XSS detection is subjected to container inclusion. In implementation, the html file can be used as a container, and the display style of the rich text information is defined in the html file, specifically including character color, font size, font style and the like. Because the container defines the display style of the rich text information, the rich text information needs to be displayed according to the display style defined by the container when different platforms read the rich text information, so that the problem of cross-platform incompatibility of the rich text information is avoided.
In addition, the rich text information mostly contains a large amount of picture and format information, and the data volume is large, so that the network transmission efficiency is influenced. Therefore, before the information to be transmitted is sent to the target address, the target address indicated by the rich text information is acquired, and the wrapped rich text information is processed by a lossless data compression algorithm (DEFLATE), so that the data volume of the information to be transmitted is reduced, and the transmission efficiency is improved.
In some possible embodiments, after XSS detection is performed on the edited rich text information, the rich text information is stored. When the user has a re-editing requirement on the edited rich text information, the rich text information can be called from the storage space by sending a re-editing instruction, and the rich text information is re-edited at an editing end. Specifically, in response to a re-edit instruction for the rich text information, a storage path of the rich text information is acquired. And calling rich text information corresponding to the storage path from the storage space, and sending the rich text information to an editing end so that a user can perform re-editing operation on the rich text information.
Based on the same inventive concept, the embodiment of the present application further provides a system architecture applying the method for publishing rich text information, specifically as shown in fig. 3, including a rich component 301, a server 302, and a display end 303.
The editing end 301 is an editing interface in office software or application with rich text information editing capability. The editing end 301 has a functional cluster for editing rich text information, such as changing font color, thickening font, adding underlines, adding subscripts, drawing cuboids, and the like.
In some possible embodiments, the editing end 301 receives configuration information imported by a user, and determines a target function selected by the user from the function cluster for information editing according to the configuration information. And then displaying the function control of the target function so that the user edits the rich text information based on the function control.
In some possible embodiments, the editing end 301, in response to the user-defined indication of the functionality control, obtains the functionality control to be modified and the user-defined functionality set corresponding to the functionality control to be modified from the user-defined indication. And modifying the function control based on the user-defined function set so that the modified function control is bound with each function in the user-defined function set.
In addition, the editing end 301 performs XSS detection on the rich text information edited by the user, so as to avoid XSS attack. The editing end 301 performs container wrapping on the rich text information after XSS detection so as to avoid the problem of cross-platform incompatibility of the rich text information. In addition, the rich text information mostly contains a large amount of picture and format information, and the data volume is large, so that the network transmission efficiency is influenced. The editing end 301 can process the wrapped rich text information by a lossless data compression algorithm (DEFLATE), so as to reduce the data volume of the information to be transmitted and improve the transmission efficiency.
The server 302 is used for providing a storage space for storing the rich text information edited by the user. The user can import the rich text information stored in the server into the editing end 301 by inquiring the storage address, and re-edit the rich text information. The user can also display and preview the rich text information to be sent by importing the rich text information stored in the server into the display end 302.
The displaying terminal 303 is configured to display rich text information to be sent, and specifically, after the editing terminal 301 performs container wrapping and compression on the rich text information that has been edited, the rich text information is stored in the server 302. The user can import the rich text information stored in the server into the display terminal 303 by querying the storage address. The presentation end 303 performs an operation of initializing the rich text container in advance with respect to the received rich text information. Specifically, the display end 303 reads the container wrapped by the outer layer, decompresses and displays the rich text information according to the style defined in the container.
It should be noted that the editing end 301, the server 302, and the display end 303 may interact in a message manner through a communication protocol. And the interaction can be carried out through a wireless network, which is not limited in the application.
Based on the same inventive concept, an embodiment of the present application further provides an apparatus 400 for publishing rich text information, specifically as shown in fig. 4, the apparatus includes:
an information obtaining module 401 configured to perform obtaining rich text information to be sent in response to the indication that the editing is completed;
the script detection module 402 is configured to perform detection on preset sensitive information in the rich text information, and perform escape processing on the detected preset sensitive information, where the preset sensitive information is information with a cross-site scripting XSS function;
an information sending module 404 configured to perform container wrapping on the rich text information and send information to be sent to a target address; the container is used for defining the display style of the rich text information, and the information to be sent is the rich text information wrapped by the container.
In some possible embodiments, before performing the acquiring rich text information to be transmitted, the information acquiring module 401 is further configured to:
receiving configuration information imported by a user;
determining a target function selected by a user from a function cluster for information editing according to the configuration information;
controlling an editing end to display a function control of the target function so that a user can edit rich text information based on the function control; and the user executes the function corresponding to the function control by controlling the function control, and each function control is bound with at least one function in the function cluster.
In some possible embodiments, the information obtaining module 401 is further configured to:
responding to a user-defined instruction of a function control, and acquiring the function control to be modified and a user-defined function set corresponding to the function control to be modified from the user-defined instruction; wherein the custom function set comprises at least one function in the function cluster;
and modifying the function control based on the user-defined function set so that each function in the user-defined function set is bound to the modified function control.
In some possible embodiments, before performing the sending of the information to be sent to the target address, the information sending module 404 is further configured to:
acquiring a target address indicated by the rich text information;
and processing the wrapped rich text information through a lossless data compression algorithm, and taking a compressed file obtained through processing as the information to be sent.
In some possible embodiments, performing the escaping processing on the detected preset sensitive information, the script detection module 402 is configured to:
and adding appointed escape tags to the preset sensitive information, wherein each appointed escape tag corresponds to at least one preset sensitive information.
In some possible embodiments, the information sending module 404 is further configured to:
storing the rich text information after XSS detection;
the information sending module 404 is further configured to:
responding to a re-editing instruction of the rich text information, and acquiring a storage path of the rich text information;
and calling rich text information corresponding to the storage path from a storage space, and sending the rich text information to an editing end so that a user can perform re-editing operation on the rich text information.
The electronic device 130 according to this embodiment of the present application is described below with reference to fig. 5. The electronic device 130 shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 5, the electronic device 130 is represented in the form of a general electronic device. The components of the electronic device 130 may include, but are not limited to: the at least one processor 131, the at least one memory 132, and a bus 133 that connects the various system components (including the memory 132 and the processor 131).
Bus 133 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
The memory 132 may include readable media in the form of volatile memory, such as Random Access Memory (RAM)1321 and/or cache memory 1322, and may further include Read Only Memory (ROM) 1323.
Memory 132 may also include a program/utility 1325 having a set (at least one) of program modules 1324, such program modules 1324 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The electronic device 130 may also communicate with one or more external devices 134 (e.g., keyboard, pointing device, etc.), with one or more devices that enable a user to interact with the electronic device 130, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 130 to communicate with one or more other electronic devices. Such communication may occur via input/output (I/O) interfaces 135. Also, the electronic device 130 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 136. As shown, network adapter 136 communicates with other modules for electronic device 130 over bus 133. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 130, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as the memory 132 comprising instructions, executable by the processor 131 of the apparatus 400 to perform the above-described method is also provided. Alternatively, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, there is also provided a computer program product comprising computer programs/instructions which when executed by the processor 131 implement any of the rich text information publishing methods as provided herein.
In an exemplary embodiment, aspects of a method for issuing rich text information provided by the present application may also be implemented in the form of a program product including program code for causing a computer device to perform the steps in a method for issuing rich text information according to various exemplary embodiments of the present application described above in this specification when the program product is run on the computer device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The program product for distribution of rich text information of embodiments of the present application may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on an electronic device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "for example" programming language or similar programming languages. The program code may execute entirely on the consumer electronic device, partly on the consumer electronic device, as a stand-alone software package, partly on the consumer electronic device and partly on a remote electronic device, or entirely on the remote electronic device or server. In the case of remote electronic devices, the remote electronic devices may be connected to the consumer electronic device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external electronic device (e.g., through the internet using an internet service provider).
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, the features and functions of two or more units described above may be embodied in one unit, according to embodiments of the application. Conversely, the features and functions of one unit described above may be further divided into embodiments by a plurality of units.
Further, while the operations of the methods of the present application are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable image scaling apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable image scaling apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable image scaling apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable image scaling device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method for publishing rich text information, the method comprising:
responding to the indication of finishing editing, and acquiring rich text information to be sent;
detecting preset sensitive information in the rich text information, and performing escape processing on the detected preset sensitive information, wherein the preset sensitive information is information with a cross-site scripting XSS function;
carrying out container wrapping on the rich text information, and sending information to be sent to a target address; the container is used for defining the display style of the rich text information, and the information to be sent is the rich text information wrapped by the container.
2. The method according to claim 1, wherein before obtaining rich text information to be sent, the method further comprises:
receiving configuration information imported by a user;
determining a target function selected by a user from a function cluster for information editing according to the configuration information;
controlling an editing end to display a function control of the target function so that a user can edit rich text information based on the function control; and the user executes the function corresponding to the function control by controlling the function control, and each function control is bound with at least one function in the function cluster.
3. The method of claim 2, further comprising:
responding to a user-defined instruction of a function control, and acquiring the function control to be modified and a user-defined function set corresponding to the function control to be modified from the user-defined instruction; wherein the custom function set comprises at least one function in the function cluster;
and modifying the function control based on the user-defined function set so that each function in the user-defined function set is bound to the modified function control.
4. The method of claim 1, wherein before sending the information to be sent to the destination address, the method further comprises:
acquiring a target address indicated by the rich text information;
and processing the wrapped rich text information through a lossless data compression algorithm, and taking a compressed file obtained through processing as the information to be sent.
5. The method according to claim 1, wherein the escaping process of the detected preset sensitive information comprises:
and adding appointed escape tags to the preset sensitive information, wherein each appointed escape tag corresponds to at least one preset sensitive information.
6. The method according to any one of claims 1-5, further comprising:
storing the rich text information after XSS detection;
the method further comprises the following steps:
responding to a re-editing instruction of the rich text information, and acquiring a storage path of the rich text information;
and calling rich text information corresponding to the storage path from a storage space, and sending the rich text information to an editing end so that a user can perform re-editing operation on the rich text information.
7. An apparatus for distributing rich text information, the apparatus comprising:
the information acquisition module is configured to execute responding to the indication of editing completion and acquire rich text information to be sent;
the script detection module is configured to detect preset sensitive information in the rich text information and perform escape processing on the detected preset sensitive information, wherein the preset sensitive information is information with a cross-site script attack XSS function;
the information sending module is configured to perform container wrapping on the rich text information and send information to be sent to a target address; the container is used for defining the display style of the rich text information, and the information to be sent is the rich text information wrapped by the container.
8. An electronic device comprising at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
9. A computer storage medium, characterized in that the computer storage medium stores a computer program for causing a computer to perform the method according to any one of claims 1-6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the method of any one of claims 1 to 6 when executed by a processor.
CN202111461482.7A 2021-12-02 2021-12-02 Rich text information publishing method and related device Pending CN114138717A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111461482.7A CN114138717A (en) 2021-12-02 2021-12-02 Rich text information publishing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111461482.7A CN114138717A (en) 2021-12-02 2021-12-02 Rich text information publishing method and related device

Publications (1)

Publication Number Publication Date
CN114138717A true CN114138717A (en) 2022-03-04

Family

ID=80387078

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111461482.7A Pending CN114138717A (en) 2021-12-02 2021-12-02 Rich text information publishing method and related device

Country Status (1)

Country Link
CN (1) CN114138717A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117389769A (en) * 2023-12-11 2024-01-12 杭州中房信息科技有限公司 Browser-end rich text copying method and system based on cloud service and cloud platform

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117389769A (en) * 2023-12-11 2024-01-12 杭州中房信息科技有限公司 Browser-end rich text copying method and system based on cloud service and cloud platform
CN117389769B (en) * 2023-12-11 2024-04-30 杭州中房信息科技有限公司 Browser-end rich text copying method and system based on cloud service and cloud platform

Similar Documents

Publication Publication Date Title
JP6740373B2 (en) Page component dynamic layout
CN102016833A (en) Techniques to modify a document using a latent transfer surface
CN113031946B (en) Method and device for rendering page component
CN104704468A (en) Cross system installation of WEB applications
US10289747B2 (en) Dynamic file concatenation
US9906626B2 (en) Resource demand-based network page generation
CN113382083B (en) Webpage screenshot method and device
CN109582317B (en) Method and apparatus for debugging hosted applications
CN111294395A (en) Terminal page transmission method, device, medium and electronic equipment
JP2023537767A (en) Image processing method and apparatus, and computer-readable storage medium
CN103493042A (en) Browsing system, terminal, image server, program, computer-readable recording medium recording said program, and method
CN113110829B (en) Multi-UI component library data processing method and device
CN114138717A (en) Rich text information publishing method and related device
CN114168853A (en) Data visualization display method, device, medium and electronic equipment
CN107862035B (en) Network reading method and device for conference record, intelligent tablet and storage medium
CN111767498B (en) Method and device for realizing file information sharing
CN113760283A (en) Text rendering method and device
CN110647327B (en) Method and device for dynamic control of user interface based on card
CN113784194A (en) Embedding method and device of video player
CN116578795A (en) Webpage generation method and device, storage medium and electronic equipment
CN113342450B (en) Page processing method, device, electronic equipment and computer readable medium
CN114528510A (en) Webpage data processing method and device, electronic equipment and medium
CN113656041A (en) Data processing method, device, equipment and storage medium
CN113377376A (en) Data packet generation method, data packet generation device, electronic device, and storage medium
CN114064065A (en) Program upgrading method and program upgrading system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination