I'm using CKEditor 4.7.
Some of my contents are HTML, some are Markdown.
For Markdown, I would like to keep CRLF chars.
Here is a text sample :
This is the result in CKEditor, everything is on one line :
In CKEditor code, I tried to print the result of editor.getSnapshot() and the raw text keeps CRLF.
In configuration, I printed too property lineBreakChars from writer object, and it seams correct.
I also already tested to delete all \r\n or 0D0A regex in ckeditor library, but it does not work.
Is there an option to keep to keep CRLF chars ?
Related
I am having a word document(docx) of urdu text in Jameel Noori Nastaleeq Font. And in word its showing 10 pages file but after exporting into PDF its showing 11 pages pdf file becuase every letter contains extra space.
Can anyone please provide information ?
Edited:
Please download the file from
File
It has to do with the XML formatting of Word. When any text is pasted into Word (while the font is Jameel Noori Nastaleeq) Word places extra formatting in between the words. That formatting shows fine in Word however in when the file is converted into PDF the extra space becomes visible. When the text is merely typed in Word, the formatting is applied to entire paragraphs rather than words. That is why a typed document doesn't contain the extra spaces.
I have a text file which contains some data, with a number of blank lines which intersperse the data.
When opened in Ubuntu, I can see the blank lines, however on a windows machine all the data is displayed on the same line with no new lines at all.
What is the reason for this?
In a text file there are characters that you can't see in the text editor that indicate a new line. On Windows it is \n\r and on Linux it is \n.
Here is a good link that will explain this in a little more detail.
I have localization strings with line breaks:
label.example=Text\nwith\nline\nbreaks
And i set the text using thymeleaf:
th:text="#{label.example}"
But the text is printed like:
Text with line breaks
But i want the text to appear like
Text
with
line
breaks
Why are my \n all deleted and not rendered into line breaks? How can i keep my line breaks? It is really important.
Because HTML considers a sequence of white space characters, including line breaks, as a single white space. Unless you tell it to preserve line breaks using CSS.
See the white-space property
I try to print pdf file from QTextDocument. Content of document is set by setHtml().
Simplified example:
QTextDocument document;
document.setHtml("<h1>My html \304\205</h1>"); // Octal encoded ą
QPrinter printer(QPrinter::HighResolution);
printer.setPageSize(QPrinter::A4);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setOutputFileName("cert.pdf");
document.print(&printer);
It does not work as expected on windows (msvc). I get pdf file with "?" in place of most polish characters. It works on ubuntu.
On windows It makes pdf with tahoma font embedded subset. How to force QPrinter or QPrintEngine to embed more characters from this (or any other) font?
As pepe suggested in comments. I needed to wrap this string one of:
QString::fromUtf8
tr() (in case of joining translated parts)
Use html escape sequence (ex. ą for ę)
My original html in program was build from tr() parts, but I forgot to octal escape some of them. (which worked on gcc, not on msvc, even with utf-8 with BOM)
When copy & pasting formatted text, where does the separation between content and formatting occur? For example, copy & pasting from Word. When the content is copied, it can be pasted into something like TinyMCE which can retain the formatting, or into a regular browser textarea which will strip the formatting.
I've been told that the stripping of the formatting occurs by the application that is having content pasted into it. Because of this, pasting formatted content is unreliable.
However, to me it seems like the clipboard either has two versions of the content, and pastes the appropriate one, or one version is copied but the formatting is somehow flagged so that an app can request the content with or without the formatting.
How and where does this separation occur?
Thanks
Since you're talking about Word, I'm assuming you're asking about Windows:
Clipboard Formats.