Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Node interception method, system and equipment based on rich text and storage medium

A node and text technology, applied in rich text-based node interception methods, equipment and storage media, and system fields, can solve problems such as the inability to accurately intercept the number of texts, and achieve the effect of wide applicability

Pending Publication Date: 2021-12-17
西安华讯科技有限责任公司
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] 1. It is not possible to accurately intercept the specific amount of text, and can only be intercepted according to paragraphs
[0005] 2. The style and text are separated, and the front end needs to be processed separately
[0006] 3. The background editing page, back-end storage, and user display all need to be modified to varying degrees

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Node interception method, system and equipment based on rich text and storage medium
  • Node interception method, system and equipment based on rich text and storage medium
  • Node interception method, system and equipment based on rich text and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0044] In order to make the object, technical solution, design method and advantages of the present invention clearer, the present invention will be further described in detail through specific embodiments below in conjunction with the accompanying drawings. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

[0045] Such as figure 1 As shown, the present invention provides a kind of node intercepting method based on rich text, comprises the following steps:

[0046] (1) Obtain the DOM node of the original rich text through JavaScript.

[0047] (2) Generate an object tree by serializing DOM nodes. After obtaining the DOM node, traverse and query the child nodes, if the child node is a text node, delete special characters, such as: ";>;<;

\r\n|\r|\n, if the child node is an ordinary node, save the node attribute traversal to the object attribute. If the child node still ha...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention belongs to the technical field of text interception, and particularly discloses a node interception method based on a rich text. The method comprises the following steps: acquiring a DOM node of an original rich text; generating an object tree by serializing DOM nodes; calculating the number of texts through a recursive node object tree, and traversing a node object tree array; when counting meets the expected number of intercepted texts, intercepting the text content, jumping out of circulation, and intercepting the remaining DOM object tree; deserializing the DOM object tree into DOM nodes, and traversing the DOM object tree; calling an innerHTML method of the DOM node to generate a rich text with a reserved style; uploading the rich text with the reserved style to a server side; and after the user side obtains the rich text, directly setting an innerHTML method of the DOM to render, so accurate interception can be completed. Through the method for serializing the DOM tree, the rich text can be intercepted according to the word number, and the style can be reserved.

Description

technical field [0001] The invention belongs to the technical field of text interception, in particular to a rich text-based node interception method, system, device and storage medium. Background technique [0002] Modern article editing is basically based on rich text editors, rich text editors, Rich Text Editor, RTE for short, is a text editor that can be embedded in a browser, what you see is what you get. It is a text editor that solves the problem that ordinary users can use different HTML and other web page tags but need to set font color, size, style and other information on the web page. [0003] With the popularity of scenarios such as paid knowledge articles, most paid articles are based on the interception of rich text paragraphs, such as get, WeChat paid articles, get paid reading and other applications. But the problems encountered in the interception based on paragraph in the prior art are as follows: [0004] 1. It is impossible to accurately capture the sp...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F40/14G06F40/166
CPCG06F40/14G06F40/166Y02D10/00
Inventor 周帅超
Owner 西安华讯科技有限责任公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products