Is it possible (and how can I) to split a paragraph of text into relevant lines using JavaScript. What I would like to do is implement the hanging punctuation on each line of a paragraph or blockquote, and not just on the start line.
Any other ideas are also welcome!
Clarification . I was asked to be less ambiguous as to what “splitting a paragraph into appropriate lines” means.
In HTML, an element <p>creates a block of text. Similarly, many other elements. These text bodies are wrapped according to the width (regardless of whether the css width is set or assumed by default). I cannot find where line breaks occur using regex or any other means. So, let the paragraph end with a length of 7 lines, I would like to discover that these are seven lines, and where these lines begin and end.
Searching \nor \r, it seems, gives nothing.
source
share