CN111222063A - Rich text rendering method and device, electronic equipment and storage medium - Google Patents

Rich text rendering method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111222063A
CN111222063A CN201911176956.6A CN201911176956A CN111222063A CN 111222063 A CN111222063 A CN 111222063A CN 201911176956 A CN201911176956 A CN 201911176956A CN 111222063 A CN111222063 A CN 111222063A
Authority
CN
China
Prior art keywords
rich text
placeholder
target
rendering
multimedia
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
CN201911176956.6A
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.)
Reach Best Technology Co Ltd
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Reach Best Technology Co Ltd
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 Reach Best Technology Co Ltd filed Critical Reach Best Technology Co Ltd
Priority to CN201911176956.6A priority Critical patent/CN111222063A/en
Publication of CN111222063A publication Critical patent/CN111222063A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9577Optimising the visualization of content, e.g. distillation of HTML documents

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The disclosure relates to a rich text rendering method, a rich text rendering device, electronic equipment and a storage medium, and aims to at least solve the problems of poor rendering effect and poor maintainability in the traditional rich text rendering process. The method comprises the following steps: acquiring symbol parameters of a target placeholder in the first rich text, wherein the target placeholder comprises target multimedia information; replacing the content of the target placeholder with a multimedia component according to the symbol parameter to obtain a second rich text; and rendering the second rich text to obtain the target multimedia page. The method and the device are applied to a scene of multimedia page display.

Description

Rich text rendering method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a rich text rendering method and apparatus, an electronic device, and a storage medium.
Background
Currently, internet content is increasingly being created and shared directly by users. In the content creation process, plain text or even simple rich text (e.g., HyperText markup Language (HTML) rich text) cannot meet the user's appeal for the browsing experience, and therefore, it is necessary to embed various multimedia contents (e.g., multimedia resources such as pictures, videos, or audios, or alternatively broadcast a set of pictures, or responsive advertisements) in the rich text.
In the conventional technology, when a browser presents multimedia content in rich text, in order to enhance the presentation effect of the multimedia content, text content in the rich text for describing the multimedia content is usually modified, and then rendering is performed.
However, since the modified text content is usually a plain text content, it is difficult to maintain, and the browser cannot distinguish the modified text content, which further causes a large amount of logic problems in the rendering process, and makes the rendering effect worse.
Disclosure of Invention
The disclosure provides a rich text rendering method, a rich text rendering device, electronic equipment and a storage medium, which are used for at least solving the problems of poor rendering effect and poor maintainability in the traditional rich text rendering process.
The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a rich text rendering method, including: acquiring symbol parameters of a target placeholder in the first rich text, wherein the target placeholder comprises target multimedia information; replacing the content of the target placeholder with a multimedia component according to the symbol parameter of the target placeholder to obtain a second rich text; and rendering the second rich text to obtain the target multimedia page.
According to a second aspect of the embodiments of the present disclosure, there is provided a rich text rendering apparatus including: the acquiring unit is configured to acquire symbol parameters of a target placeholder in the first rich text, wherein the target placeholder contains target multimedia information; the replacing unit is configured to replace the content of the target placeholder with a multimedia component according to the symbol parameter of the target placeholder acquired by the acquiring module to obtain a second rich text; and the rendering unit is configured to render the second rich text obtained by the replacing unit to obtain the target multimedia page.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor, a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement a rich text rendering method as shown in the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium having instructions that, when executed by a processor of a rich text rendering apparatus, enable the rich text rendering apparatus to perform the rich text rendering method as shown in the first aspect.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product directly loadable into an internal memory of a computer and containing software code, the computer program being loadable and executable by the computer to implement the rich text rendering method shown in the first aspect.
The technical scheme provided by the embodiment of the disclosure at least has the following beneficial effects: after the rich text rendering device obtains the symbol parameters of the target placeholder in the first rich text, the content of the target placeholder can be replaced by the multimedia component according to the symbol parameters of the target placeholder, and a second rich text is obtained. Because the content formats of the multimedia component and other contents in the second rich text are different, the front and back contents of the multimedia component in the second rich text can be isolated, so that when the rich text rendering device renders the second rich text, a large number of logic problems can be avoided, a target multimedia page with better rendering effect can be efficiently and quickly obtained, and the rendering efficiency of the whole rich text rendering process is improved. Meanwhile, the replaced content is in a component form, so that the maintainability and the research and development efficiency of the replaced content are improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is an architectural diagram illustrating one implementation environment in accordance with an exemplary embodiment;
FIG. 2 is a method flow diagram illustrating a rich text rendering method in accordance with an exemplary embodiment;
FIG. 3 is a block diagram illustrating a rich text rendering apparatus in accordance with an exemplary embodiment;
FIG. 4 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Before describing the rich text rendering method provided by the embodiment of the present disclosure in detail, a brief description is given here to an application scenario and an implementation environment related to the embodiment of the present disclosure.
In the conventional technology, when a browser presents multimedia content in rich text, in order to enhance the presentation effect of the multimedia content, text content in the rich text for describing the multimedia content is usually replaced, and then rendering is performed. Taking HTML rich text as an example, since the replaced text content is usually pure HTML text content, it is difficult to include CSS for describing styles and JavaScript (a programming language) script for executing logic, so that the pure HTML text content is difficult to maintain independently, which is not conducive to modularization and seriously affects research and development efficiency.
In order to solve the problem, according to the technical scheme provided by the embodiment of the disclosure, the content of the target placeholder in the rich text is directly replaced by the multimedia component, and the multimedia component is used for isolating the front content and the rear content of the multimedia component in the rich text, so that a large number of logic problems are avoided in the subsequent rich text rendering process, a target multimedia page with a better rendering effect can be efficiently and quickly obtained, and the rendering efficiency of the whole rich text rendering process is improved. Meanwhile, because the replaced content is in a component form, the maintainability and the research and development efficiency of the replaced content are improved.
1) Simply introduce the application scenarios related to the embodiments of the present disclosure
In the embodiment of the present disclosure, the rich text rendering method may be applied to a multimedia page display scene, and may also be applied to other multimedia scenes, which is not limited by the present disclosure.
For example, in a content editing stage, only a few parameters are needed to describe multimedia content (e.g., multimedia content such as pictures, audio, video, etc., or advertisements, etc.) that needs to be embedded in a rich text, however, in a rich text rendering scene, text content (e.g., a specific HTML tag) in the rich text for describing the multimedia content needs to be replaced by renderable text content, and then rendering is performed, and a multimedia page corresponding to the multimedia content can be displayed after rendering.
2) Brief introduction to the implementation Environment related to the embodiments of the present disclosure
FIG. 1 is an architectural diagram of one possible implementation environment in which the following rich text rendering method may be applied, as shown in FIG. 1. The implementation environment includes an electronic device 01 and a server 02. Wherein, the electronic device 01 and the server 02 may be interconnected and communicate through a network.
The electronic device 01 may be a device capable of performing a rich text rendering function, and an application program (e.g., a browser) capable of executing a rich text rendering process is run in the electronic device 01, so that after receiving the rich text fed back by the server 02, the electronic device 01 may execute a corresponding text replacement process and a text rendering process on the rich text through the application program.
The electronic device 01 may be any electronic product that can interact with a user through one or more modes, such as a keyboard, a touch pad, a touch screen, a remote controller, a voice interaction device, or a handwriting device, for example, a mobile phone, a tablet Computer, a palm Computer, a Personal Computer (PC), a wearable device, a smart television, and the like.
The server 02 may be one server, a server cluster composed of a plurality of servers, or a cloud computing service center.
In a general internet service, the server 02 is only responsible for providing meta-information (e.g. rich text), various clients perform the decision of presentation style, and different clients can produce completely different visual effects for the same piece of meta-information. In the embodiment of the invention, the electronic device abstracts different visuals into mutually independent multimedia components for multiplexing, namely, converting specific content in rich text into corresponding multimedia components.
It will be understood by those skilled in the art that the foregoing electronic devices and servers are merely exemplary and that other existing or future electronic devices or servers may be suitable for use with the present disclosure and are intended to be included within the scope of the present disclosure and are hereby incorporated by reference.
The technical scheme provided by the application is described below with reference to the accompanying drawings.
Fig. 2 is a flowchart illustrating a rich text rendering method applied to a rich text rendering apparatus according to an exemplary embodiment, where the rich text rendering method includes the following steps, as shown in fig. 2.
In step S11, symbolic parameters of the target placeholders in the first rich text are obtained.
In the embodiment of the present disclosure, after receiving a first rich text sent by a server, a symbol parameter of a target placeholder in the first rich text may be obtained.
Generally, rich text content mainly comes from two sources, namely a rich text editor and crawling by a crawler program. Regardless of the source, the obtained rich text content is generally pure and does not contain html tags which are dedicated to user interaction or do not directly contribute to the article content. In other words, almost every pair of html tags of the obtained rich text content contains a part of the article content. For example, the label corresponding to the picture is < img >, the label corresponding to the video is < video > </video >, and the label corresponding to the audio is < audio > </audio >.
In an embodiment of the present disclosure, the symbol parameters of the target placeholder include: a position and a length of the target placeholder in the first rich text; the target placeholder includes target multimedia information, that is, the characters included in the placeholder in the first rich text are characters for representing multimedia information (e.g., picture information, audio information, video information, etc.).
In one example, to perform secondary processing (e.g., rendering) on external resources referenced by multimedia information in the first rich text, the embodiments of the present disclosure save the detail information of these resources separately as structured data, so that the corresponding storage location is directly annotated in the placeholder containing the corresponding multimedia information without using html tags.
In one example, the placeholder in the first rich text may include, in addition to the multimedia information, detail information of an external resource referred by the multimedia information.
In step S12, the content of the target placeholder in the first rich text is replaced with a multimedia component according to the symbol parameter of the target placeholder, resulting in a second rich text.
In an embodiment of the present disclosure, the target placeholder may be at least one placeholder in the first rich text.
In the embodiment of the present disclosure, when replacing the content of the target placeholder, the content of the target placeholder may be replaced with the corresponding multimedia component according to the display effect corresponding to the target multimedia information in the target placeholder.
For example, since the character position of the target placeholder in the first rich text and the character length of the target placeholder itself are known, the target placeholder can be replaced conveniently, that is, only a part of the target placeholder in the first rich text can be replaced, and the other part is not processed.
In addition, compared with the traditional replacement process, the text content for describing the multimedia content is replaced by the character string with the fixed template, the embodiment of the disclosure replaces the specific placeholder in the rich text by the multimedia component, so that the multimedia component plays an isolation role in the rich text, and further, in the rich text rendering process, the problems of data conflict and data confusion caused by the fact that the replaced content is consistent with the context format are avoided, and the rich text rendering efficiency and accuracy are improved.
Optionally, in the embodiment of the present disclosure, in an Vue (a rendering tool) environment, the multimedia component may be a Vue component. It can be appreciated that in the Vue environment, the electronic device compiles the content in the target placeholder directly into the Vue component and then hands it to the Vue framework for rendering, and the maintainability of the Vue component is improved.
Illustratively, in the Vue environment, the target placeholder is replaced with pure Vue template syntax that is fully enabled with ": colon for property delivery and" @ "notation for event binding.
In step S13, the second rich text is rendered, resulting in the target multimedia page.
Optionally, in this disclosure, the step S12 may include the following step S12 a:
in step S12a, the placeholders in the first rich text are traversed.
Illustratively, in the process of traversing the placeholders in the first rich text, if the content of the currently traversed placeholder includes multimedia information corresponding to the target multimedia type, the currently traversed placeholder is taken as the target placeholder.
Illustratively, in the process of traversing the placeholders in the first rich text, if the content of the currently traversed placeholder does not include the multimedia information corresponding to the target multimedia type, the next placeholder of the currently traversed placeholder is continuously traversed.
Further optionally, in the embodiment of the present disclosure, in the step S12a, the placeholders in the first rich text may be traversed in the first rich text in the order of the placeholders in the first rich text. Or the placeholders in the first rich text may be traversed in a reverse order according to the order of the placeholders in the first rich text, which is not limited in the embodiment of the present disclosure.
For example, when traversing the placeholders in the first rich text in the reverse order, the placeholders in the first rich text may be traversed in the reverse order from the last character of the first rich text according to the precedence order of the placeholders in the first rich text, or the placeholders in the first rich text may be traversed in the reverse order from the last place of the first rich text according to the precedence order of the placeholders in the first rich text, which is not limited in this disclosure.
In addition, when traversing the placeholder in the first rich text, each character in the first rich text may be traversed, and of course, only the placeholder in the first rich text may be traversed, which is not limited in the embodiment of the present disclosure.
Because the content replacement behavior for a certain placeholder may generally change the position of other characters subsequent to the placeholder in the whole rich text, the way of traversing the placeholder in the reverse order can avoid the increased amount of calculation due to the change of the position of the subsequent placeholder, and the traversing efficiency of the whole placeholder is improved.
Illustratively, in the process of traversing the placeholders in the first rich text, for each placeholder, pattern matching may be performed by using a regular expression corresponding to the content of the placeholder according to the format of the placeholder, and the placeholder parameters of the placeholder and the multimedia type of the multimedia information included in the placeholder are extracted. For example, the regular expression (e.g. JavaScript language) corresponding to the content of a placeholder can be expressed as: l <! - { (img | video | audio): (\ d +) }-/ig.
In one example, each pattern matching process requires four pieces of information that know the placeholder: (1) character length of the placeholder; (2) the multimedia type of the multimedia information contained in the placeholder, e.g., the content matched by the first parenthesis in the regular expression example above, may be at least one of img, video, and audio in general; (3) the sequence number in the DetailArray pointed to by the placeholder, i.e., the content matched by the second parenthesis in the regular expression example above, is a positive integer that increases from 0; (4) the character position of the first character of the placeholder in the entire rich text.
In one example, in JavaScript language, the exec method of the RegExp object instance may be used to call multiple times to match out all placeholders, store the above four pieces of information of each placeholder together in a hash table structure, and store all hash table structures in an ordered array S in a reverse order. Then, traversing the array S according to the sequence of all the placeholders in the array S, which is equivalent to traversing all the placeholders in a reverse order. Wherein, the four pieces of information in each hash structure are respectively: matches (placeholders full content), tag (placeholder type), tagIndex (ordinal in DetailArray), index (character position of placeholder first character in the whole rich text).
Optionally, in this disclosure, the step S13 may include the following step S13 a:
in step S13a, according to the symbolic parameter of the target placeholder, the character content of the target placeholder is replaced with a multimedia component by using a component editing function, so as to obtain a second rich text.
For example, the component editing function may include a render function or other functions that can perform component editing, which is not limited in the embodiments of the present disclosure.
For example, declaring a JavaScript object that contains a render function can become a legitimate Vue component. The specific implementation can be referred to the following code 1, in which:
code 1:
Figure BDA0002290215440000071
wherein the "custom-video" and "custom-audio" in the above procedure are subcomponents of the Vue assembly.
Further, when the render function returns, a template real-time compiling method built in an Vue framework is required to be used: and (4) complie. The method returns a hash table structure where there is an entry called render function, and uses this render as the render for the above Vue component. In order to be able to respond Vue to a change in the template string in the component, the render function is updated, which may be recompiled by listening for changes to the template string as an incoming property of the component, and the render function is updated. The specific implementation can be referred to the following code 2, wherein:
code 2:
Figure BDA0002290215440000072
Figure BDA0002290215440000081
according to the rich text rendering method provided by the embodiment of the disclosure, after the symbol parameter of the target placeholder in the first rich text is obtained, the rich text rendering device can replace the content of the target placeholder with the multimedia component according to the symbol parameter of the target placeholder to obtain the second rich text. Because the content formats of the multimedia component and other contents in the second rich text are different, the front and back contents of the multimedia component in the second rich text can be isolated, so that when the rich text rendering device renders the second rich text, a target multimedia page with a better rendering effect can be efficiently and quickly obtained, and the rendering efficiency of the whole rich text rendering process is improved.
FIG. 3 is a block diagram illustrating a rich text rendering apparatus according to an example embodiment. Referring to fig. 3, the rich text rendering apparatus 200 includes an acquisition unit 201, a replacement unit 202, and a rendering unit 203, in which: an obtaining unit 201, configured to obtain symbol parameters of a target placeholder in the first rich text, where the target placeholder includes target multimedia information; a replacing unit 202, configured to replace the content of the target placeholder with a multimedia component according to the symbol parameter obtained by the obtaining module 201, so as to obtain a second rich text; and the rendering unit 203 is configured to render the second rich text obtained by the replacing unit 202 to obtain the target multimedia page.
Optionally, as shown in fig. 3, the rich text rendering apparatus 200 further includes: traverse unit 204, wherein: and the traversing unit is configured to traverse the placeholders in the first rich text, and if the content of the currently traversed placeholder comprises multimedia information corresponding to the target multimedia type, the currently traversed placeholder is used as the target placeholder.
Optionally, the traversing unit 204 is configured to continue traversing the next placeholder of the currently traversed placeholder if the content of the currently traversed placeholder does not include the multimedia information corresponding to the target multimedia type.
Optionally, the traversing unit 204 is configured to traverse the placeholders in the first rich text in a reverse order according to the precedence order of the placeholders in the first rich text.
Optionally, the replacing unit is specifically configured to replace the character content of the target placeholder with a multimedia component by using a component compiling function according to the symbol parameter acquired by the acquiring module 201, so as to obtain a second rich text.
After the symbol parameter of the target placeholder in the first rich text is obtained, the rich text rendering device provided by the embodiment of the disclosure can replace the content of the target placeholder with a multimedia component according to the symbol parameter of the target placeholder to obtain a second rich text. Because the content formats of the multimedia component and other contents in the second rich text are different, the front and back contents of the multimedia component in the second rich text can be isolated, so that when the rich text rendering device renders the second rich text, a target multimedia page with a better rendering effect can be efficiently and quickly obtained, and the rendering efficiency of the whole rich text rendering process is improved.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
It should be noted that, as shown in fig. 3, modules that are necessarily included in the rich text rendering apparatus 200 are indicated by solid line boxes, such as the obtaining unit 201; modules that may or may not be included in the rich text rendering apparatus 200 are illustrated with dashed boxes, such as the traversal unit 204.
FIG. 4 is a block diagram illustrating an electronic device 300 for rich text rendering according to an example embodiment. The electronic devices include, but are not limited to, mobile phones, tablet computers, notebook computers, palm computers, vehicle-mounted terminals, wearable devices, pedometers, and the like. As shown in fig. 4, electronic device 300 includes, but is not limited to: a processor 301, a memory 302, a display 303, an input unit 304, an output unit 305, a network unit 306, an interface unit 307, a radio frequency unit 308, a power supply 309, a sensor 310, and the like.
The processor 301 is a memory for storing executable instructions of the processor; wherein the processor 301 is configured to execute the instructions to implement the method. It will be appreciated that the processor 301 described above is configured to perform any of the steps of the method described above.
It should be noted that the electronic device structure shown in fig. 4 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown in fig. 4, or combine some components, or arrange different components, as will be understood by those skilled in the art.
The processor 301 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 302 and calling data stored in the memory 302, thereby performing overall monitoring of the electronic device. Processor 301 may include one or more processing units; optionally, the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly handles operating systems, user interfaces, application programs, and the like, and the modem processor mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 301.
The memory 302 may be used to store software programs as well as various data. The memory 302 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 302 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The display 303 is used to display information input by the user or information provided to the user. The Display 303 may include a Display panel, and the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an organic light-Emitting Diode (OLED), or the like.
The input unit 304 may be used to receive audio or video signals. The input Unit 304 may include a Graphics Processing Unit (GPU) that processes image data of still pictures or video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode, and a microphone. The processed image frames may be displayed on the display 303. The image frames processed by the graphics processor may be stored in the memory 302 (or other storage medium) or transmitted via the radio frequency unit 308 or the network unit 306. The microphone may receive sound and be capable of processing such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 308 in case of the phone call mode.
The input unit 304 may be a user input unit operable to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user input unit includes a touch panel and other input devices. A touch panel, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel (e.g., operations by a user on or near the touch panel using a finger, a stylus, or any other suitable object or attachment). The touch panel may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 301, receives a command from the processor 301, and executes the command. In addition, the touch panel may be implemented in various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The user input unit may include other input devices in addition to the touch panel. Specifically, the other input devices may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
Further, the touch panel may be overlaid on the display panel, and when the touch panel detects a touch operation thereon or nearby, the touch panel transmits the touch operation to the processor 301 to determine the type of the touch event, and then the processor 301 provides a corresponding visual output on the display panel according to the type of the touch event. The touch panel and the display panel 3061 may be used as two independent components to implement the input and output functions of the electronic device, or the touch panel and the display panel may be integrated to implement the input and output functions of the electronic device, which is not limited herein.
The output unit 305 may be an audio output unit, and may convert audio data received by the radio frequency unit 308 or the network unit 306 or stored in the memory 302 into an audio signal and output as sound. Also, the audio output unit may also provide audio output related to a specific function performed by the electronic apparatus 300 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit comprises a loudspeaker, a buzzer, a receiver and the like.
The electronic device provides wireless broadband internet access to the user via the network unit 306, such as assisting the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The interface unit 307 is an interface for connecting an external device to the electronic apparatus 300. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 307 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic apparatus 300 or may be used to transmit data between the electronic apparatus 300 and the external device.
The radio frequency unit 308 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink data from a base station and then process the received downlink data to the processor 301; in addition, the uplink data is transmitted to the base station. Typically, the radio frequency unit 308 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio unit 308 can also communicate with a network and other devices through a wireless communication system.
A power source 309 (e.g., a battery) may be used to power the various components, and optionally, the power source 309 may be logically connected to the processor 301 via a power management system, such that functions of managing charging, discharging, and power consumption are performed via the power management system.
The sensor 310 may include at least one of a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that adjusts the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that turns off the display panel and/or the backlight when the electronic device 300 is moved to the ear. As one type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of an electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 310 may also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be described in detail herein.
In addition, the electronic device 300 includes some functional modules (e.g., a camera) not shown, which are not described herein.
In an exemplary embodiment, the disclosed embodiments also provide a storage medium comprising instructions, such as the memory 302 comprising instructions, executable by the processor 301 of the electronic device 300 to perform the above-described method. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a Read-Only Memory (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, the disclosed embodiments also provide a computer program product comprising one or more instructions executable by the processor 301 of the electronic device 300 to perform the above-described method.
It should be noted that the instructions in the storage medium or one or more instructions in the computer program product are executed by the processor 301 to implement the processes of the method embodiments, and the same technical effect can be achieved.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A rich text rendering method, comprising:
acquiring symbol parameters of a target placeholder in a first rich text, wherein the target placeholder comprises target multimedia information;
replacing the content of the target placeholder with a multimedia component according to the symbol parameter to obtain a second rich text;
and rendering the second rich text to obtain a target multimedia page.
2. The rich text rendering method of claim 1, wherein prior to the step of obtaining symbolic parameters of target placeholders in the first rich text, the method further comprises:
traversing placeholders in the first rich text;
and if the content of the currently traversed placeholder comprises multimedia information corresponding to the target multimedia type, taking the currently traversed placeholder as the target placeholder.
3. The rich text rendering method of claim 2, wherein in traversing the placeholders in the first rich text, the method further comprises:
and if the content of the currently traversed placeholder does not contain the multimedia information corresponding to the target multimedia type, continuously traversing the next placeholder of the currently traversed placeholder.
4. A rich text rendering method according to claim 2 or 3, wherein the step of traversing placeholders in the first rich text comprises:
and traversing the placeholders in the first rich text in a reverse order according to the sequence of the placeholders in the first rich text.
5. The method for rendering rich text according to claim 1, wherein the step of replacing the content of the target placeholder with a multimedia component according to the symbol parameter to obtain the second rich text comprises:
and replacing the content of the target placeholder with a multimedia component by adopting a component compiling function according to the symbol parameter to obtain the second rich text.
6. A rich text rendering apparatus, comprising:
the acquiring unit is configured to acquire symbol parameters of a target placeholder in the first rich text, wherein the target placeholder comprises target multimedia information;
the replacing unit is configured to replace the content of the target placeholder with a multimedia component according to the symbol parameter obtained by the obtaining module to obtain a second rich text;
and the rendering unit is configured to render the second rich text obtained by the replacing unit to obtain a target multimedia page.
7. The rich text rendering device according to claim 6, further comprising:
and the traversing unit is configured to traverse the placeholders in the first rich text, and if the content of the currently traversed placeholder comprises multimedia information corresponding to a target multimedia type, the currently traversed placeholder is used as the target placeholder.
8. The rich text rendering device of claim 7, wherein the traversal unit is configured to traverse the placeholders in the first rich text in reverse order according to the precedence order of the placeholders in the first rich text.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement a rich text rendering method as claimed in any one of claims 1 to 5.
10. A storage medium in which instructions are executable by a processor of a rich text rendering apparatus to enable the rich text rendering apparatus to perform a rich text rendering method according to any one of claims 1 to 5.
CN201911176956.6A 2019-11-26 2019-11-26 Rich text rendering method and device, electronic equipment and storage medium Pending CN111222063A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911176956.6A CN111222063A (en) 2019-11-26 2019-11-26 Rich text rendering method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911176956.6A CN111222063A (en) 2019-11-26 2019-11-26 Rich text rendering method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111222063A true CN111222063A (en) 2020-06-02

Family

ID=70829039

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911176956.6A Pending CN111222063A (en) 2019-11-26 2019-11-26 Rich text rendering method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111222063A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112765506A (en) * 2021-01-22 2021-05-07 广州优谷信息技术有限公司 Page text content display method, device, equipment and storage medium
CN113486636A (en) * 2021-07-07 2021-10-08 建信金融科技有限责任公司 Text labeling method and device
CN113656006A (en) * 2021-08-18 2021-11-16 广东触电传媒科技有限公司 Rich text rendering method and rendering equipment
CN114925656A (en) * 2022-06-14 2022-08-19 北京新唐思创教育科技有限公司 Rich text display method, device, equipment and storage medium
CN115209215A (en) * 2021-04-09 2022-10-18 北京字跳网络技术有限公司 Video processing method, device and equipment
CN115309298A (en) * 2022-08-30 2022-11-08 医渡云(北京)技术有限公司 Text structuring method and device, medium and equipment based on rich text editor
CN116842125A (en) * 2023-08-28 2023-10-03 武汉乾云软件开发中心(有限合伙) Storage method of rich media information and natural language intelligent retrieval method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170147545A1 (en) * 2015-11-25 2017-05-25 Box, Inc. Creating shared content in a device-independent content editor using a native operating system interface
CN108805960A (en) * 2018-05-31 2018-11-13 北京字节跳动网络技术有限公司 Composing Method of Mixing, device, computer readable storage medium and terminal
CN109299446A (en) * 2018-08-03 2019-02-01 新华三大数据技术有限公司 Report-generating method and device
CN109949391A (en) * 2019-03-18 2019-06-28 武汉斗鱼鱼乐网络科技有限公司 Graphic rendering method, apparatus, electronic equipment and storage medium
CN110187878A (en) * 2019-05-29 2019-08-30 北京三快在线科技有限公司 A kind of page generation method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170147545A1 (en) * 2015-11-25 2017-05-25 Box, Inc. Creating shared content in a device-independent content editor using a native operating system interface
CN108805960A (en) * 2018-05-31 2018-11-13 北京字节跳动网络技术有限公司 Composing Method of Mixing, device, computer readable storage medium and terminal
CN109299446A (en) * 2018-08-03 2019-02-01 新华三大数据技术有限公司 Report-generating method and device
CN109949391A (en) * 2019-03-18 2019-06-28 武汉斗鱼鱼乐网络科技有限公司 Graphic rendering method, apparatus, electronic equipment and storage medium
CN110187878A (en) * 2019-05-29 2019-08-30 北京三快在线科技有限公司 A kind of page generation method and device

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112765506A (en) * 2021-01-22 2021-05-07 广州优谷信息技术有限公司 Page text content display method, device, equipment and storage medium
CN112765506B (en) * 2021-01-22 2023-10-24 广州优谷信息技术有限公司 Page text content display method, device, equipment and storage medium
CN115209215A (en) * 2021-04-09 2022-10-18 北京字跳网络技术有限公司 Video processing method, device and equipment
CN113486636A (en) * 2021-07-07 2021-10-08 建信金融科技有限责任公司 Text labeling method and device
CN113656006A (en) * 2021-08-18 2021-11-16 广东触电传媒科技有限公司 Rich text rendering method and rendering equipment
CN113656006B (en) * 2021-08-18 2023-06-30 广东触电传媒科技有限公司 Rich text rendering method and rendering device
CN114925656A (en) * 2022-06-14 2022-08-19 北京新唐思创教育科技有限公司 Rich text display method, device, equipment and storage medium
CN115309298A (en) * 2022-08-30 2022-11-08 医渡云(北京)技术有限公司 Text structuring method and device, medium and equipment based on rich text editor
CN115309298B (en) * 2022-08-30 2024-05-10 医渡云(北京)技术有限公司 Text structuring method and device based on rich text editor, medium and equipment
CN116842125A (en) * 2023-08-28 2023-10-03 武汉乾云软件开发中心(有限合伙) Storage method of rich media information and natural language intelligent retrieval method
CN116842125B (en) * 2023-08-28 2023-12-26 武汉乾云软件开发中心(有限合伙) Storage method of rich media information and natural language intelligent retrieval method

Similar Documents

Publication Publication Date Title
CN111222063A (en) Rich text rendering method and device, electronic equipment and storage medium
CN111274777B (en) Thinking guide display method and electronic equipment
CN105740263B (en) Page display method and device
CN107943390B (en) Character copying method and mobile terminal
WO2017084452A1 (en) Method and apparatus for processing tag page in graphical interface
CN107908765B (en) Game resource processing method, mobile terminal and server
CN109085968B (en) Screen capturing method and terminal equipment
CN111177180A (en) Data query method and device and electronic equipment
CN112116690B (en) Video special effect generation method, device and terminal
CN108989869B (en) Video picture playing method, device, equipment and computer readable storage medium
CN113313804B (en) Image rendering method and device, electronic equipment and storage medium
CN111399819B (en) Data generation method, device, electronic equipment and storage medium
CN111159338A (en) Malicious text detection method and device, electronic equipment and storage medium
CN107885799A (en) Info web display methods and device
CN111158815B (en) Dynamic wallpaper blurring method, terminal and computer readable storage medium
CN109947988B (en) Information processing method and device, terminal equipment and server
CN111405043A (en) Information processing method and device and electronic equipment
CN105335434B (en) Log management method and device and electronic equipment
CN110471895B (en) Sharing method and terminal device
CN109063079B (en) Webpage labeling method and electronic equipment
CN109325212B (en) Information interaction method and device, electronic equipment and browser
CN110888572A (en) Message display method and terminal equipment
CN111050223A (en) Bullet screen information processing method and electronic equipment
CN115828845A (en) Multimedia data viewing method, device, medium and equipment
CN111416955B (en) Video call method and electronic equipment

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