CN109582932A - Wechat small routine rich text conversion method and electronic equipment based on educational system - Google Patents

Wechat small routine rich text conversion method and electronic equipment based on educational system Download PDF

Info

Publication number
CN109582932A
CN109582932A CN201811196525.1A CN201811196525A CN109582932A CN 109582932 A CN109582932 A CN 109582932A CN 201811196525 A CN201811196525 A CN 201811196525A CN 109582932 A CN109582932 A CN 109582932A
Authority
CN
China
Prior art keywords
rich text
label
character string
node
small routine
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
CN201811196525.1A
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.)
Shenzhen Dianmao Technology Co Ltd
Original Assignee
Shenzhen Dianmao 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 Shenzhen Dianmao Technology Co Ltd filed Critical Shenzhen Dianmao Technology Co Ltd
Priority to CN201811196525.1A priority Critical patent/CN109582932A/en
Publication of CN109582932A publication Critical patent/CN109582932A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)

Abstract

The invention discloses a kind of wechat small routine rich text conversion method and electronic equipment based on educational system, wherein comprising steps of the carrying node after A. setting rich text parsing, reads rich text content and simultaneously define the AST root node root finally returned that;B. rich text character string is obtained, and resolves into multiple labels;C. label substance is searched for, and corresponding relationship is established according to label object;D. judge whether rich text character string is parsed;E. after the completion of rich text character string parsing, node is rendered, carries out attribute conversion, scheme of the present invention can be realized the conversion of wechat small routine rich text, increase its compatibility.

Description

Wechat small routine rich text conversion method and electronic equipment based on educational system
Technical field
The present invention relates to application domain more particularly to a kind of wechat small routine rich text conversions based on educational system Method and electronic equipment.
Background technique
The rich text label (rich-text) of small routine does not support video at present, needs in rich text in existing business When video is added, video tab will directly be ignored, and can not be resolved.The rich text of small routine is supported to inline style at present Modification, modification inline style can not come into force, all patterns can only be completed in editor, call when can not make Adjustment, flexibility ratio are very low.
Therefore, the existing technology needs to be improved and developed.
Summary of the invention
In view of above-mentioned deficiencies of the prior art, the purpose of the present invention is to provide a kind of wechat little Cheng based on educational system Sequence rich text conversion method and electronic equipment, it is intended to solve the problems, such as that wechat small routine rich text flexibility is low.
Technical scheme is as follows:
A kind of wechat small routine rich text conversion method based on educational system, wherein comprising steps of
A. the carrying node after setting rich text parses reads rich text content and defines the AST root node finally returned that root;
B. rich text character string is obtained, and resolves into multiple labels;
C. label substance is searched for, and corresponding relationship is established according to label object;
D. judge whether rich text character string is parsed;
E. after the completion of rich text character string parsing, node is rendered, carries out attribute conversion.
The wechat small routine rich text conversion method based on educational system, wherein the step B includes: to richness Text-string is looped through;It is that beginning is matched with < label;Start-tag is matched using canonical, obtains closure mark Label.
The wechat small routine rich text conversion method based on educational system, wherein the step C includes: to obtain The character string of single closure label;Checking label content;Html is label converting for the identifiable label of small routine;Define label Attribute, title, obtain a label object;Inline style is detected, style attribute is assigned to;By label object according to father and son Grade relationship is mounted under root.
The wechat small routine rich text conversion method based on educational system, wherein the step D includes: to obtain Tag length;Intercept the correspondence length of rich text character string;Judge remaining rich text character string whether be it is empty, when to be empty, then Rich text is parsed.
The wechat small routine rich text conversion method based on educational system, wherein the step E includes: pop-up Root node;Equal pending datas update;Data, which update, to be completed, by the rendering of root node on the carrying node after rich text parsing; Recursion resolution AST tree successively renders;Node is rendered according to the modularity of small routine.
A kind of electronic equipment, wherein including processor, it is adapted for carrying out each instruction, and
Equipment is stored, is suitable for storing a plurality of instruction, described instruction is suitable for being loaded and being executed by processor:
Carrying node after rich text parsing is arranged reads rich text content and defines the AST root node finally returned that root;
Rich text character string is obtained, and resolves into multiple labels;
Label substance is searched for, and corresponding relationship is established according to label object;
Judge whether rich text character string is parsed;
After the completion of rich text character string parsing, node is rendered, carries out attribute conversion.
The electronic equipment, wherein the processor is also used to load and execute: rich text character string is recycled Traversal;It is that beginning is matched with < label;Start-tag is matched using canonical, obtains closure label.
The electronic equipment, wherein the processor is also used to load and execute: the character of single closure label is obtained String;Checking label content;Html is label converting for the identifiable label of small routine;Attribute, the title for defining label, obtain one A label object;Inline style is detected, style attribute is assigned to;Label object is mounted under root according to father and son's grade relationship.
The electronic equipment, wherein the processor is also used to load and execute: tag length is obtained;The rich text of interception The correspondence length of this character string;Judge whether remaining rich text character string is sky, when to be empty, then rich text is parsed.
The electronic equipment, wherein the processor is also used to load and execute: pop-up root node;Equal pending datas It updates;Data, which update, to be completed, by the rendering of root node on the carrying node after rich text parsing;Recursion resolution AST tree, successively Rendering;Node is rendered according to the modularity of small routine.
The utility model has the advantages that the invention discloses a kind of wechat small routine rich text conversion method and electronics based on educational system Equipment, wherein comprising steps of the carrying node after A. setting rich text parsing, reads rich text content and definition finally returns that AST root node root;B. rich text character string is obtained, and resolves into multiple labels;C. label substance is searched for, and according to label Object establishes corresponding relationship;D. judge whether rich text character string is parsed;E. right after the completion of rich text character string parsing Node is rendered, and attribute conversion is carried out, and scheme of the present invention can be realized the conversion of wechat small routine rich text, is increased Its compatibility.
Detailed description of the invention
Present invention will be further explained below with reference to the attached drawings and examples, in attached drawing:
Fig. 1 is the step flow chart of the wechat small routine rich text conversion method of the present invention based on educational system.
Fig. 2 is the structural schematic diagram of electronic equipment of the present invention.
Specific embodiment
The present invention provides a kind of wechat small routine rich text conversion method and electronic equipment based on educational system, to make this The purpose of invention, technical solution and effect are clearer, define, and the present invention is described in more detail below.It should be appreciated that this Locate described specific embodiment to be only used to explain the present invention, be not intended to limit the present invention.
Referring to Fig. 1, the step of being the wechat small routine rich text conversion method of the present invention based on educational system, flows Cheng Tu, the wechat small routine rich text conversion method based on educational system that the invention discloses a kind of, wherein comprising steps of
S1. the carrying node after setting rich text parses reads rich text content and defines the AST root node finally returned that root;
S2. rich text character string is obtained, and resolves into multiple labels;
S3. label substance is searched for, and corresponding relationship is established according to label object;
S4. judge whether rich text character string is parsed;
S5. after the completion of rich text character string parsing, node is rendered, carries out attribute conversion.
Further, the wechat small routine rich text conversion method based on educational system, wherein the step S2 It include: to be looped through to rich text character string;It is that beginning is matched with < label;Start-tag is matched using canonical, is obtained To closure label.
Further, the wechat small routine rich text conversion method based on educational system, wherein the step S3 It include: the character string for obtaining single closure label;Checking label content;Html is label converting for the identifiable mark of small routine Label;Attribute, the title for defining label, obtain a label object;Inline style is detected, style attribute is assigned to;By label pair As being mounted under root according to father and son's grade relationship.
Further, the wechat small routine rich text conversion method based on educational system, wherein the step S4 It include: acquisition tag length;Intercept the correspondence length of rich text character string;Judge whether remaining rich text character string is sky, When to be empty, then rich text is parsed.
Further, the wechat small routine rich text conversion method based on educational system, wherein the step S5 It include: pop-up root node;Equal pending datas update;Data, which update, to be completed, by root node rendering holding after rich text parsing It carries on node;Recursion resolution AST tree successively renders;Node is rendered according to the modularity of small routine.
Further, the invention also discloses a kind of electronic equipment 10, as shown in Fig. 2, being the structure of the electronic equipment Schematic diagram, wherein including processor 110, it is adapted for carrying out each instruction, and
Equipment 120 is stored, is suitable for storing a plurality of instruction, described instruction is suitable for being loaded and being executed by processor 110:
Carrying node after rich text parsing is arranged reads rich text content and defines the AST root node finally returned that root;
Rich text character string is obtained, and resolves into multiple labels;
Label substance is searched for, and corresponding relationship is established according to label object;
Judge whether rich text character string is parsed;
After the completion of rich text character string parsing, node is rendered, carries out attribute conversion.
The processor 110 can for general processor, digital signal processor (DSP), specific integrated circuit (ASIC), Field programmable gate array (FPGA), single-chip microcontroller, ARM (Acorn RISC Machine) or other programmable logic device are divided Any combination of vertical door or transistor logic, discrete hardware component or these components.In addition, processor can also be any Conventional processors, microprocessor or state machine.Processor also may be implemented as calculating the combination of equipment, for example, DSP and Wei Chu Manage combination, multi-microprocessor, one or more microprocessors combination DSP core, any other this configuration of device.
It stores equipment 120 and is used as a kind of non-volatile computer readable storage medium storing program for executing, can be used for storing non-volatile software Program, non-volatile computer executable program and module, such as the corresponding journey of educational interaction method in the embodiment of the present invention Sequence instruction.Processor is stored in non-volatile software program, instruction and unit in storage equipment by operation, thereby executing The various function application and data processing of educational interaction method, i.e. realization above method embodiment.
The electronic equipment includes but is not limited to:
(1) mobile communication equipment: the characteristics of this kind of equipment is that have mobile communication function, and to provide speech, data Communication is main target.This Terminal Type includes: intelligent electronic device (such as iPhone), multimedia electronic equipment, functional electric Sub- equipment and low-end electronic equipment etc..
(2) super mobile personal computer equipment: this kind of equipment belongs to the scope of personal computer, there is calculating and processing function Can, generally also have mobile Internet access characteristic.This Terminal Type includes: PDA, MID and UMPC equipment etc., such as iPad.
(3) portable entertainment device: this kind of equipment can show and play video content, generally also have mobile Internet access spy Property.Such equipment includes: video player, handheld device and intelligent toy and portable car-mounted navigation equipment.
(4) other have the electronic equipment for touching screen.
Further, the electronic equipment, wherein the processor 110 is also used to load and execute: to rich text word Symbol string is looped through;It is that beginning is matched with < label;Start-tag is matched using canonical, obtains closure label.
Further, the electronic equipment, wherein the processor 110 is also used to load and execute: acquisition is individually closed Close the character string of label;Checking label content;Html is label converting for the identifiable label of small routine;Define the category of label Property, title, obtain a label object;Inline style is detected, style attribute is assigned to;Label object is closed according to father and son's grade System is mounted under root.
Further, it is long the electronic equipment, wherein the processor 110 is also used to load and execute: to obtain label Degree;Intercept the correspondence length of rich text character string;Judge remaining rich text character string whether be it is empty, when to be empty, then rich text It is parsed.
Further, the electronic equipment, wherein the processor 110 is also used to load and execute: pop-up root section Point;Equal pending datas update;Data, which update, to be completed, by the rendering of root node on the carrying node after rich text parsing;Recursive solution AST tree is analysed, is successively rendered;Node is rendered according to the modularity of small routine.
In conclusion the invention discloses a kind of wechat small routine rich text conversion method and electronics based on educational system Equipment, wherein comprising steps of the carrying node after A. setting rich text parsing, reads rich text content and definition finally returns that AST root node root;B. rich text character string is obtained, and resolves into multiple labels;C. label substance is searched for, and according to label Object establishes corresponding relationship;D. judge whether rich text character string is parsed;E. right after the completion of rich text character string parsing Node is rendered, and attribute conversion is carried out, and scheme of the present invention can be realized the conversion of wechat small routine rich text, is increased Its compatibility.
It should be understood that the application of the present invention is not limited to the above for those of ordinary skills can With improvement or transformation based on the above description, all these modifications and variations all should belong to the guarantor of appended claims of the present invention Protect range.

Claims (10)

1. a kind of wechat small routine rich text conversion method based on educational system, which is characterized in that comprising steps of
A. the carrying node after setting rich text parses reads rich text content and defines the AST root node root finally returned that;
B. rich text character string is obtained, and resolves into multiple labels;
C. label substance is searched for, and corresponding relationship is established according to label object;
D. judge whether rich text character string is parsed;
E. after the completion of rich text character string parsing, node is rendered, carries out attribute conversion.
2. the wechat small routine rich text conversion method according to claim 1 based on educational system, which is characterized in that institute Stating step B includes: to loop through to rich text character string;It is that beginning is matched with < label;It is matched and is originated using canonical Label obtains closure label.
3. the wechat small routine rich text conversion method according to claim 2 based on educational system, which is characterized in that institute Stating step C includes: the character string for obtaining single closure label;Checking label content;It can know html is label converting for small routine Other label;Attribute, the title for defining label, obtain a label object;Inline style is detected, style attribute is assigned to;It will Label object is mounted under root according to father and son's grade relationship.
4. the wechat small routine rich text conversion method according to claim 3 based on educational system, which is characterized in that institute Stating step D includes: acquisition tag length;Intercept the correspondence length of rich text character string;Judging remaining rich text character string is No is sky, when to be empty, then rich text is parsed.
5. the wechat small routine rich text conversion method according to claim 4 based on educational system, which is characterized in that institute Stating step E includes: pop-up root node;Equal pending datas update;Data, which update, to be completed, and the rendering of root node is parsed in rich text On carrying node afterwards;Recursion resolution AST tree successively renders;Node is rendered according to the modularity of small routine.
6. a kind of electronic equipment, which is characterized in that including processor, it is adapted for carrying out each instruction, and
Equipment is stored, is suitable for storing a plurality of instruction, described instruction is suitable for being loaded and being executed by processor:
Carrying node after rich text parsing is arranged reads rich text content and defines the AST root node root finally returned that;
Rich text character string is obtained, and resolves into multiple labels;
Label substance is searched for, and corresponding relationship is established according to label object;
Judge whether rich text character string is parsed;
After the completion of rich text character string parsing, node is rendered, carries out attribute conversion.
7. electronic equipment according to claim 6, which is characterized in that the processor is also used to load and execute: to richness Text-string is looped through;It is that beginning is matched with < label;Start-tag is matched using canonical, obtains closure mark Label.
8. electronic equipment according to claim 7, which is characterized in that the processor is also used to load and execute: obtaining The character string of single closure label;Checking label content;Html is label converting for the identifiable label of small routine;Define label Attribute, title, obtain a label object;Inline style is detected, style attribute is assigned to;By label object according to father and son Grade relationship is mounted under root.
9. electronic equipment according to claim 8, which is characterized in that the processor is also used to load and execute: obtaining Tag length;Intercept the correspondence length of rich text character string;Judge remaining rich text character string whether be it is empty, when to be empty, then Rich text is parsed.
10. electronic equipment according to claim 9, which is characterized in that the processor is also used to load and execute: pop-up Root node;Equal pending datas update;Data, which update, to be completed, by the rendering of root node on the carrying node after rich text parsing; Recursion resolution AST tree successively renders;Node is rendered according to the modularity of small routine.
CN201811196525.1A 2018-10-15 2018-10-15 Wechat small routine rich text conversion method and electronic equipment based on educational system Pending CN109582932A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811196525.1A CN109582932A (en) 2018-10-15 2018-10-15 Wechat small routine rich text conversion method and electronic equipment based on educational system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811196525.1A CN109582932A (en) 2018-10-15 2018-10-15 Wechat small routine rich text conversion method and electronic equipment based on educational system

Publications (1)

Publication Number Publication Date
CN109582932A true CN109582932A (en) 2019-04-05

Family

ID=65920051

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811196525.1A Pending CN109582932A (en) 2018-10-15 2018-10-15 Wechat small routine rich text conversion method and electronic equipment based on educational system

Country Status (1)

Country Link
CN (1) CN109582932A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111274760A (en) * 2020-01-09 2020-06-12 北京字节跳动网络技术有限公司 Rich text data processing method and device, electronic equipment and computer storage medium
CN113342416A (en) * 2021-06-09 2021-09-03 上海万物新生环保科技集团有限公司 Method and equipment for displaying H5 graphic data in applet

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004178011A (en) * 2002-11-22 2004-06-24 Toshiba Corp Document conversion device and documents conversion method
CN103034700A (en) * 2012-12-05 2013-04-10 北京奇虎科技有限公司 Rich text content processing method and system
CN104461519A (en) * 2014-11-23 2015-03-25 国云科技股份有限公司 Method for dynamically producing flow chart and controlling authority
CN105095206A (en) * 2014-04-18 2015-11-25 富士通株式会社 Information processing method and information processing device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004178011A (en) * 2002-11-22 2004-06-24 Toshiba Corp Document conversion device and documents conversion method
CN103034700A (en) * 2012-12-05 2013-04-10 北京奇虎科技有限公司 Rich text content processing method and system
CN105095206A (en) * 2014-04-18 2015-11-25 富士通株式会社 Information processing method and information processing device
CN104461519A (en) * 2014-11-23 2015-03-25 国云科技股份有限公司 Method for dynamically producing flow chart and controlling authority

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111274760A (en) * 2020-01-09 2020-06-12 北京字节跳动网络技术有限公司 Rich text data processing method and device, electronic equipment and computer storage medium
CN111274760B (en) * 2020-01-09 2023-07-18 抖音视界有限公司 Rich text data processing method and device, electronic equipment and computer storage medium
CN113342416A (en) * 2021-06-09 2021-09-03 上海万物新生环保科技集团有限公司 Method and equipment for displaying H5 graphic data in applet

Similar Documents

Publication Publication Date Title
US11409813B2 (en) Method and apparatus for mining general tag, server, and medium
CN109522018B (en) Page processing method and device and storage medium
US8819012B2 (en) Accessing anchors in voice site content
CN107204184A (en) Audio recognition method and system
CN104021231B (en) The method and apparatus that webpage is shown in browser
CN109358936A (en) Information processing method, device, storage medium, electronic equipment and system
CN107291476A (en) Canvas code generating methods, device, electronic equipment and storage medium
CN107798123B (en) Knowledge base and establishing, modifying and intelligent question and answer methods, devices and equipment thereof
CN109558128A (en) Json data analysis method, device and computer readable storage medium
CN106569824A (en) Page data compiling method and apparatus, and page rendering method and apparatus
CN110852079A (en) Document directory automatic generation method and device and computer readable storage medium
CN109145235B (en) Method and device for analyzing webpage and electronic equipment
CN108491326A (en) Behavioral test recombination method, device and storage medium
CN110297636A (en) A kind of automatic production of HTML page and parameter management method based on page configuration file, system and device
CN107958078A (en) Information generating method and device
CN107861944A (en) A kind of text label extracting method and device based on Word2Vec
CN109582932A (en) Wechat small routine rich text conversion method and electronic equipment based on educational system
CN109445773A (en) A kind of language based on programming promotes the method and electronic equipment of browser performance
CN110007906A (en) Processing method, device and the server of script file
CN110795069A (en) Code analysis method, intelligent terminal and computer readable storage medium
Bolin End-user programming for the web
RU2005115976A (en) PARTIAL UNSOLVED INPUT DATA ANALYSIS MECHANISM
CN109669678A (en) Template engine integration method, device, electronic equipment and storage medium
CN110147358B (en) Construction method and construction system of automatic question-answering knowledge base
CN109542460A (en) A kind of method and electronic equipment based on access typescript in the vue for educating operating 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190405