-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Styles are not support in the html #14
Comments
I think you are wrong. This library supports basic styling such as u, strong, etc html tags. Can you please provide small rtf text sample to verify this? |
This is my sample RTF Test: This is my code: |
Hi seems like it is invalid or corrupted rtf. Are you able to see that content is some rtf viewer? Can you please provide rtf file?
|
Hi,
I tried this file
…On Mon, Aug 24, 2020 at 3:23 PM Romick2005 ***@***.***> wrote:
Hi seems like it is invalid or corrupted rtf. Are you able to see that
content is some rtf viewer? Can you please provide rtf file?
Also can you please try this:
const rtfToHTML = ***@***.***/rtf-to-html');
const rtfString = '{\\rtf1\\ansi\\deff0 hi \\b there\\b0 \\ul there \\ulnone\\i there\\i0\\par }';
rtfToHTML.fromString(
rtfString,
(err, html) => {
if (err) {
console.error("Error: ", err);
return;
}
console.log(html);
// Prints a document containing:
// <p>hi <strong>there</strong> <u>there </u><em>there</em></p>
}
);
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQVNUAYVG73AK6QV6B6FUSDSCJLVTANCNFSM4QFYNMVA>
.
|
I have this examples and the conversion failed. :( const rtfToHTML = require('@iarna/rtf-to-html') const a = '{\rtf1\ansi\ansicpg1252\deff0\nouicompat{\fonttbl{\f0\fnil\fcharset0 Arial;}{\f1\fnil\fcharset0 Arial Black;}{\f2\fnil\fcharset0 Courier New;}{\f3\fnil\fcharset0 Georgia;}{\f4\fnil\fcharset0 Tahoma;}{\f5\fnil\fcharset0 Times New Roman;}{\f6\fnil\fcharset0 Verdana;}}{\colortbl ;}{\pard My\ const b = '{\rtf1\ansi\b hi there\b0}'; rtfToHTML.fromString(b, (err, html) => { i got // " empty " |
Have you tried to check error inside callback function? |
I tried this package. In my RTF file adding Bold, Italic, Underline styles. But after converting to html.
It display as a plain text only in the html.
The text was updated successfully, but these errors were encountered: