CN114519334B - Multi-line text display method and device with label, storage medium and electronic equipment - Google Patents

Multi-line text display method and device with label, storage medium and electronic equipment Download PDF

Info

Publication number
CN114519334B
CN114519334B CN202210406840.2A CN202210406840A CN114519334B CN 114519334 B CN114519334 B CN 114519334B CN 202210406840 A CN202210406840 A CN 202210406840A CN 114519334 B CN114519334 B CN 114519334B
Authority
CN
China
Prior art keywords
text
label
tag
floating
line
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.)
Active
Application number
CN202210406840.2A
Other languages
Chinese (zh)
Other versions
CN114519334A (en
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.)
Beijing Jindi Technology Co Ltd
Original Assignee
Beijing Jindi 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 Beijing Jindi Technology Co Ltd filed Critical Beijing Jindi Technology Co Ltd
Priority to CN202210406840.2A priority Critical patent/CN114519334B/en
Publication of CN114519334A publication Critical patent/CN114519334A/en
Application granted granted Critical
Publication of CN114519334B publication Critical patent/CN114519334B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • 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/117Tagging; Marking up; Designating a block; Setting of attributes

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)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a method, a device, a storage medium and electronic equipment for displaying multi-line texts with labels, wherein the method comprises the following steps: positioning a tag in a second floating tag by using a first floating tag arranged in a current page; and setting a third label in the current page, wherein the third label is used for hiding partial content of the text. The technical problem that the ellipses press part of characters due to the fact that the page used for displaying the texts is restrained by the display space and the display range, the texts exceeding the display space and the display range are directly set to be hidden, and the ellipses are displayed is solved. The technical effects that when overflow exists in multi-line text display, text before the label is omitted, and the ellipses representing the document omission do not shield the characters are achieved. Compared with the solution of multi-line text overflow realized by the CSS through the webkit-box and the webkit-line-clip, the method can be better compatible with various browsers.

Description

Multi-line text display method and device with label, storage medium and electronic equipment
Technical Field
The invention relates to the field of text processing, in particular to a method and a device for displaying multi-line text with a label, a storage medium and electronic equipment.
Background
When the text is displayed, the page for displaying the text has the constraints of a display space and a display range. The show text receives the show space, the restraint of show scope, it is more to cause the unable all scenes that show of text content, use the little letter propelling movement control daily newspaper function of certain APP as an example, this function is bound the monitor function and the little letter of certain APP, realize the propelling movement of information, little letter can be to the control daily newspaper of user propelling movement every day, because the text content of show is more, show in the page with the mode that the multirow shows more, only show partial text has, and show the demonstration demand of the label of this text of mark behind the partial text that shows.
In order to improve the user experience of the user for watching the text, in the prior art, a text truncation mode is adopted to omit the display of the text beyond the display space and the display range, the used implementation scheme is that the text beyond the limit line number limit is directly set to be hidden, an ellipsis is added after the displayed text, and a label for summarizing or explaining the text is arranged at the lower right corner of the last line of the displayable lines, namely the display effect of directly positioning one ellipsis and label is often shown in fig. 1, fig. 1 shows a multi-line text display effect, wherein, in a certain multi-line text display page, multi-line text overflow is processed, in the administrative permission dimension of a company detail page, the processing mode is to hide the text beyond the limit line number, the label is positioned at the lower right side of the last line capable of being displayed, and the scheme is uncertain in the width of the font, the effect that the ellipses press part of the characters is generated. The existing CSS style can realize single-line text overflow omission in a fixed length and multi-line text overflow omission in the fixed line, but the CSS style is not compatible with the realization mode.
Disclosure of Invention
In view of this, the present invention provides a method, an apparatus, a storage medium, and an electronic device for displaying a multi-line text with a tag, which can solve the technical problem that a page for displaying a text is constrained by a display space and a display range, the text beyond the display space and the display range is directly set to be hidden, and an ellipsis caused by displaying the ellipsis presses part of the text.
The invention provides a multi-line text display method with labels. The method comprises the following steps:
positioning a tag in a second floating tag by using a first floating tag arranged in a current page;
and setting a third label in the current page, wherein the third label is used for hiding partial content of the text.
Optionally, the label is a label summarizing or explaining a text corresponding to a text node, where the text node is a node corresponding to a text content of a piece of text to be displayed.
Optionally, the display mode of the current page includes a direct display mode and a multi-line text display mode with a tag; the direct display mode is that all text contents of the text are directly displayed in the current page; the multi-line text display mode with the label is to display partial text content of the text in a multi-line text display mode with the label in the current page.
Optionally, determining a number of rows of the first floating tag based on the location of the tag in the second floating tag; the attribute of the first floating tag is set to clear floating.
Optionally, the third tag is located after the second floating tag; and text content behind the tag in the second floating tag and text content in the third tag are set to be hidden.
Optionally, the content of the first floating tag is empty.
Optionally, an ellipsis is added before the label.
The invention provides a multi-line text display device with labels. The device comprises:
a label positioning module: the method comprises the steps that a first floating label set in a current page is used for positioning a label in a second floating label;
hiding the module: and setting a third label in the current page, wherein the third label is used for hiding partial content of the text.
The invention provides a storage medium, wherein a plurality of instructions are stored in the storage medium; the plurality of instructions for loading and executing the method of any of the preceding claims by a processor.
The present invention provides an electronic device, including:
a processor for executing a plurality of instructions;
a memory to store a plurality of instructions;
wherein the instructions are for storage by the memory and for loading and executing by the processor the method of any preceding claim.
According to the invention, through setting the label, the text content is displayed in the label, based on the number of text lines which can be displayed on the display page, through height comparison and by using the characteristics of the floating label, the technical effects that when overflow exists in multi-line text display, the text in front of the label is omitted, and the ellipses for representing document omission do not shield the characters are realized. Compared with the solution of multi-line text overflow realized by CSS through webkit-box and webkit-line-clip, the method and the system can be better compatible with various browsers.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent by describing in more detail embodiments of the present invention with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings, like reference numbers generally represent like parts or steps.
FIG. 1 is a diagram illustrating the display effect of a prior art method of directly positioning an ellipsis and labels;
FIG. 2 is a flow diagram illustrating a method for displaying multi-line text with labels according to an exemplary embodiment of the invention;
fig. 3 is a schematic diagram illustrating a display effect of a multi-line text display method with labels according to an exemplary embodiment of the present invention;
fig. 4 is a schematic diagram illustrating an effect of setting a tag in a multi-line text display method with a tag according to an exemplary embodiment of the present invention;
fig. 5 is a schematic diagram illustrating an effect of setting a second floating tag in a multi-line text display method with tags according to an exemplary embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating the effect of a first floating tag on tag positioning in a multi-line text display method with tags according to an exemplary embodiment of the present invention;
fig. 7 is a schematic diagram illustrating an effect of a third tag hiding partial content of a multi-line text in a multi-line text display method with a tag according to an exemplary embodiment of the present invention;
fig. 8 is a schematic diagram illustrating an effect of adding an ellipsis before a label in a multi-line text display method with labels according to an exemplary embodiment of the present invention;
FIG. 9 is a schematic diagram of a multi-line text display device with labels according to an exemplary embodiment of the present invention;
fig. 10 is a structure of an electronic device provided by an exemplary embodiment of the present invention.
Detailed Description
Hereinafter, example embodiments according to the present invention will be described in detail with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a subset of embodiments of the invention and not all embodiments of the invention, with the understanding that the invention is not limited to the example embodiments described herein.
It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
It will be understood by those of skill in the art that the terms "first," "second," "S1," "S2," and the like in the embodiments of the present invention are used merely to distinguish one step, device, or module from another, and do not denote any particular technical meaning or necessarily order therebetween.
It should also be understood that in embodiments of the present invention, "a plurality" may refer to two or more and "at least one" may refer to one, two or more.
It is also to be understood that any reference to any component, data, or structure in the embodiments of the invention may be generally understood as one or more, unless explicitly defined otherwise or stated to the contrary hereinafter.
In addition, the term "and/or" in the present invention is only one kind of association relationship describing the associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In the present invention, the character "/" generally indicates that the preceding and following related objects are in an "or" relationship.
It should also be understood that the description of the embodiments of the present invention emphasizes the differences between the embodiments, and the same or similar parts may be referred to each other, so that the descriptions thereof are omitted for brevity.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
Embodiments of the invention are operational with numerous other general purpose or special purpose computing system environments or configurations, and with numerous other electronic devices, such as terminal devices, computer systems, servers, etc. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with electronic devices, such as terminal devices, computer systems, servers, and the like, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, networked personal computers, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Exemplary method
Fig. 2 is a flowchart illustrating a method for displaying multi-line text with a label according to an exemplary embodiment of the present invention. The embodiment can be applied to an electronic device, as shown in fig. 2, and includes the following steps:
step S1, positioning the label in the second floating label by using the first floating label set in the current page;
and step S2, setting a third label in the current page, wherein the third label is used for hiding partial content of the text.
The method and the device have the technical effects that when overflow exists in multi-line text display, the text in front of the label is omitted, and the ellipses for representing the document omission do not shield the characters. Fig. 3 is a schematic diagram illustrating a display effect of a method for displaying multi-line text with a tag according to an exemplary embodiment of the present invention, where an ellipsis indicating document omission does not block a word when the page shown in fig. 3 displays multi-line text.
The step S1, positioning the tag in the second floating tag by using the first floating tag set in the current page, wherein:
the label is a label for summarizing or explaining a text corresponding to a text node, the text node is a node corresponding to the text content of a piece of text to be displayed, and all the text content of the piece of text to be displayed can be displayed in the text node. The manner of adding the tag in the second floating tag is to set the tag as an in-line element of the second floating tag and place the tag behind the text of the second floating tag, and the effect of adding the tag in the second floating tag is as shown in fig. 4. Here, only by way of example, the tag is placed in the second floating tag behind the text of the second floating tag, and in actual use, the position of the tag can be set according to the display position requirement of the tag.
The current page can display one or more texts, and each text displayed on the current page has a preset line number threshold, namely each text displayed on the current page displays at most a threshold line. And determining the display mode of the current page based on the preset line number threshold and the line number of the text node. The display modes comprise a direct display mode and a multi-line text display mode with labels, wherein the direct display mode is to directly display all text contents of the text in the current page; the multi-line text display mode with the label is that in the current page, partial text content of the text is displayed in a multi-line text display mode with the label, and the multi-line text display mode belongs to overflow display. For example, the height of the text node is obtained through javascript, and the text node line number is determined based on the line height of each line. And if the line number occupied by all the text contents of a certain text is less than or equal to the preset line number threshold, directly displaying all the text contents of the text in the current page. And if the line number occupied by all the text contents of a certain text is larger than the preset line number threshold value, displaying the text in the current page by adopting a multi-line text display method with a label.
In another embodiment, the display mode of the current page is determined based on the preset threshold of line number and the height of the text node. For example, the height of the text node is obtained through javascript, if the height of the text node exceeds the height corresponding to the preset line number threshold, taking the preset line number threshold of the current page as 2 as an example, if the height of each line is 22px, the height of the text node is obtained through javascript, and if the height of the text node is less than or equal to 2 × 22px, all text contents of the text are directly displayed in the current page. If the height of the text node is greater than 2 × 22px, a part of text content of the text needs to be displayed in a multi-line text display mode with a label, and the number of lines occupied by the displayed part of text content is equal to the preset number threshold of lines of the current page. Specifically, two display structures are arranged in html in advance, and one display structure is suitable for a direct display mode; another display structure is suitable for a multiple line text display mode with labels. And acquiring the height of the text node through javascript so as to determine which display structure is used for displaying.
A second floating tab is provided for securing a label in a designated position on the second floating tab, e.g., securing the label to the rightmost side of the first row of the second floating tab. Taking the second floating tag as a parent tag, after the tag is added to the second floating tag, because the parent tag is a floating tag, in the second floating tag, the tag is fixed at a specified position of the second floating tag, for example, the tag is fixed at the rightmost side of the first line of the second floating tag, because floating elements can achieve a text surrounding effect, as shown in fig. 5, in the second floating tag, text surrounding the tag can be achieved, and the text cannot be blocked. However, the text of the second floating label is in a text surrounding form, and the display is not regular, so that subsequent setting is required.
In order to display only threshold row words, and the row tail of the last row of the threshold row words is provided with a label, the invention adopts the first floating label arranged in the current page to position the label in the second floating label, namely, the row number of the first floating label is determined based on the position of the label in the second floating label.
For example, if the tag is at row2 of the second floating tag, then row1 of the first floating tag is set, such that row1= threshold-row 2. Since the plurality of floating tags are displayed in parallel on the same horizontal line of the current page, the position of the first floating tag can be set above the second floating tag by setting the attribute of the first floating tag to clear floating. In this way, by displaying 1 lines of texts on the first floating tag, displaying 2 lines of texts on the second floating tag, and setting the texts behind 2 lines of the second floating tag as hidden, only the threshold lines of texts are displayed when the current page displays the text, and the rightmost side of the last line of texts has tags, and the text content is not occluded. As shown in fig. 6, if it is desired that the labels are displayed on the rightmost side of the second row and the labels are set to the rightmost side of the first row in the second floating labels, it is necessary to set the first floating label having a height of one row, the first floating label is initially empty, and the attribute of the first floating label is set to clear floating, and the second floating label can be arranged below the first floating label by the first floating label and the labels are displayed on the rightmost side of the second row. If the attribute of the first floating label is not set to clear floating, the second floating label is displayed side by side with the first floating label, and the expected effect cannot be achieved.
It should be noted that, in order to make the first floating tag not affect the display of the text content, the content of the first floating tag may be selected to be null.
Since there may be multiple lines of text content in the second floating tag and there may also be multiple lines of text content after the tag, in this embodiment, further, the text content after the tag in the second floating tag is set as hidden.
In step S2, a third tab is set in the current page, and the third tab is used to hide part of the content of the text.
In this embodiment, since the possible data size of the text displayed on the current page is large, only the first floating tag and the second floating tag cannot store all text contents of the text. And setting a third label, wherein the third label is positioned behind the second floating label, the capacity of the third label is set to be a maximum value, the third label is used for storing the content of the text which cannot be stored in the first floating label and the second floating label, and the display attribute of the third label is set to be hidden for hiding the part of the content of the text.
Specifically, the text contents to be hidden by the second floating tag and the third floating tag can be hidden by setting overflow: hidden. For example, a preset row number threshold value threshold is obtained, then based on the row height h of each row, overhead: hidden = threshold × hpx is set, and then the row behind the tag in the second floating tag and the rows of the third tag are set as hidden, as shown in fig. 7.
Further, as shown in fig. 8, before the label, an ellipsis is added, so that a display effect that a plurality of rows with ellipsis are omitted and the text is not blocked is obtained.
Exemplary devices
Fig. 9 is a schematic structural diagram of a multi-line text display device with a label according to an exemplary embodiment of the present invention. As shown in fig. 9, the apparatus includes a label positioning module 91 and a hiding module 92:
the tag positioning module 91 is configured to position a tag in the second floating tag by using the first floating tag set in the current page;
a hiding module 92 configured to set a third tag in the current page, where the third tag is used for hiding a part of contents of a text.
The label is a label for summarizing or explaining a text corresponding to a text node, and the text node is a node corresponding to the text content of a piece of text to be displayed.
Optionally, the display mode of the current page includes a direct display mode and a multi-line text display mode with a tag; the direct display mode is that all text contents of the text are directly displayed in the current page; the multi-line text display mode with the label is to display partial text content of the text in a multi-line text display mode with the label in the current page.
Optionally, the tag positioning module 91 is specifically configured to determine the number of rows of the first floating tag based on the position of the tag in the second floating tag; the attribute of the first floating tag is set to clear floating.
It should be noted that, in order to make the first floating tag not affect the display of the text content, the content of the first floating tag may be selected to be null.
Optionally, a hiding module 92, configured specifically to locate the third label behind the second floating label; and setting the text content behind the label in the second floating label and the text content in the third label as hidden.
Optionally, the label positioning module 91 is further specifically configured to add an ellipsis before the label.
It should be noted that the multi-line text display device with labels shown in fig. 9 corresponds to the multi-line text display method with labels in the present invention, and for the description thereof, reference may be made to the description of the multi-line text display method with labels in the present invention, and details are not repeated here.
Exemplary electronic device
Fig. 10 is a structure of an electronic device according to an exemplary embodiment of the present invention. The electronic device may be either or both of the first device and the second device, or a stand-alone device separate from them, which stand-alone device may communicate with the first device and the second device to receive the acquired input signals therefrom. FIG. 10 illustrates a block diagram of an electronic device in accordance with an embodiment of the disclosure. As shown in fig. 10, the electronic device includes one or more processors 101 and memory 102.
The processor 101 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
Memory 102 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by the processor 101 to implement the labeled multiple-line text display method of the software program of the various embodiments of the present disclosure described above and/or other desired functions. In one example, the electronic device may further include: an input device 103 and an output device 104, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
The input device 103 may also include, for example, a keyboard, a mouse, and the like.
The output device 104 may output various information to the outside. The output devices 104 may include, for example, a display, speakers, a printer, and a communication network and its connected remote output devices, among others.
Of course, for simplicity, only some of the components of the electronic device relevant to the present disclosure are shown in fig. 10, omitting components such as buses, input/output interfaces, and the like. In addition, the electronic device may include any other suitable components, depending on the particular application.
Exemplary computer program product and computer-readable storage Medium
In addition to the methods and apparatus described above, embodiments of the present disclosure may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in a method of multiple line text display with labels according to various embodiments of the present disclosure described in the "exemplary methods" section above of this specification.
The computer program product may write program code for carrying out operations for embodiments of the present disclosure 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 "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform steps in a method of displaying multiple lines of text with labels according to various embodiments of the present disclosure as described in the "exemplary methods" section above in this specification.
The computer-readable storage medium may take 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 include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 foregoing describes the general principles of the present disclosure in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present disclosure are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present disclosure. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the disclosure is not intended to be limited to the specific details so described.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The block diagrams of devices, apparatuses, devices, systems involved in the present disclosure are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably herein. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
The methods and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
It is also noted that in the devices, apparatuses, and methods of the present disclosure, each component or step can be decomposed and/or recombined. These decompositions and/or recombinations are to be considered equivalents of the present disclosure. The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the disclosure to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (6)

1. A method of displaying multiple lines of text with labels, comprising:
positioning a tag in a second floating tag by using a first floating tag arranged in a current page;
setting a third tag in the current page, wherein the third tag is used for hiding partial content of text,
determining a number of rows of the first floating tag based on the location of the tag in the second floating tag; the attribute of the first floating tag is set to clear float,
the third label is located behind the second floating label; the text content behind the label in the second floating label and the text content in the third label are set to be hidden,
the contents of the first floating tag are empty,
adding an ellipsis before the tag in the second floating tag.
2. The method of claim 1, wherein the label in the second floating label is a label summarizing or explaining a text corresponding to a text node, and the text node is a node corresponding to a text content of a piece of text to be displayed.
3. The method of claim 2, wherein the display modes of the current page include a direct display mode and a multi-line text display mode with tags; the direct display mode is to directly display all text contents of the text in the current page; the multi-line text display mode with the label is to display partial text content of the text in a multi-line text display mode with the label in the current page.
4. A multi-line text display apparatus having a label, the apparatus comprising:
a label positioning module: the method comprises the steps that a first floating label set in a current page is used for positioning a label in a second floating label;
hiding the module: configured to set a third tag in the current page, the third tag being used to hide a part of content of text,
determining a number of rows of the first floating tag based on the location of the tag in the second floating tag; the attribute of the first floating tag is set to clear float,
the third label is located behind the second floating label; the text content behind the label in the second floating label and the text content in the third label are set to be hidden,
the contents of the first floating tag are empty,
adding an ellipsis before the tag in the second floating tag.
5. A computer-readable storage medium having stored therein a plurality of instructions; the plurality of instructions for being loaded by a processor and for performing the method of any of claims 1-3.
6. An electronic device, characterized in that the electronic device comprises:
a processor for executing a plurality of instructions;
a memory to store a plurality of instructions;
wherein the plurality of instructions are to be stored by the memory and to be loaded and executed by the processor to perform the method of any of claims 1-3.
CN202210406840.2A 2022-04-19 2022-04-19 Multi-line text display method and device with label, storage medium and electronic equipment Active CN114519334B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210406840.2A CN114519334B (en) 2022-04-19 2022-04-19 Multi-line text display method and device with label, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210406840.2A CN114519334B (en) 2022-04-19 2022-04-19 Multi-line text display method and device with label, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN114519334A CN114519334A (en) 2022-05-20
CN114519334B true CN114519334B (en) 2022-07-08

Family

ID=81600081

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210406840.2A Active CN114519334B (en) 2022-04-19 2022-04-19 Multi-line text display method and device with label, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114519334B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104571978A (en) * 2015-01-09 2015-04-29 中科宇图天下科技有限公司 Method for paging and printing documents based on HTML (Hypertext Markup Language) labels
CN113238747A (en) * 2021-05-11 2021-08-10 北京沃东天骏信息技术有限公司 Label generation method and system for self-adaptive container display
CN113377275A (en) * 2021-07-14 2021-09-10 亿览在线网络技术(北京)有限公司 Interface presentation method based on label
CN113408241A (en) * 2021-07-16 2021-09-17 网易(杭州)网络有限公司 Text data processing method and device, electronic equipment and readable medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140143663A1 (en) * 2012-11-21 2014-05-22 Appsense Limited Systems and methods for providing contextual based truncation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104571978A (en) * 2015-01-09 2015-04-29 中科宇图天下科技有限公司 Method for paging and printing documents based on HTML (Hypertext Markup Language) labels
CN113238747A (en) * 2021-05-11 2021-08-10 北京沃东天骏信息技术有限公司 Label generation method and system for self-adaptive container display
CN113377275A (en) * 2021-07-14 2021-09-10 亿览在线网络技术(北京)有限公司 Interface presentation method based on label
CN113408241A (en) * 2021-07-16 2021-09-17 网易(杭州)网络有限公司 Text data processing method and device, electronic equipment and readable medium

Also Published As

Publication number Publication date
CN114519334A (en) 2022-05-20

Similar Documents

Publication Publication Date Title
US8856647B2 (en) Font handling for viewing documents on the web
CA2815391C (en) Systems, methods, and interfaces for display of inline content and block level content on an access device
CN106294658B (en) Webpage quick display method and device
CN109408752B (en) Online document display method and device and electronic equipment
US7676741B2 (en) Structural context for fixed layout markup documents
EP3607460A1 (en) Smarter copy/paste
CA3155636C (en) Dynamic typesetting
CN111915705B (en) Picture visual editing method, device, equipment and medium
CN110597583B (en) Method and device for ceiling of modal frame, storage medium and electronic equipment
CN115543238B (en) Browser page printing method, device, equipment and storage medium
US10042820B2 (en) Method for converting OOXML formatted spreadsheets to HTML for web presentation
US20170031889A1 (en) Creating a communication editable in a browser independent of platform and operating system
CN114519334B (en) Multi-line text display method and device with label, storage medium and electronic equipment
US20090106651A1 (en) Rendering Data From A Server For Display In A Web Browser On A Client Computer
CN112667939A (en) Webpage refreshing method and device, electronic equipment and storage medium
CN114676097A (en) OFD file processing method, device, equipment and medium
US10303740B2 (en) Autonomous document formatting mechanism
CN113934351B (en) Map screenshot method and device and computer-readable storage medium
CN110109729B (en) Interface layout adjustment method and device, electronic equipment and storage medium
CN117348960A (en) Webpage content export method, device, equipment and medium
CN114722321A (en) Webpage content processing method and device, electronic equipment and storage medium
CN113703699A (en) Real-time output method and device of electronic file
CN113051502A (en) Webpage saving method, device, equipment and storage medium
NZ715377A (en) Systems, methods, and interfaces for display of inline content and block level content on an access device
NZ715377B2 (en) Systems, methods, and interfaces for display of inline content and block level content on an access device

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
GR01 Patent grant
GR01 Patent grant