New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cuescript-rtf-to-html

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cuescript-rtf-to-html

Modfied version if @iarna/rtf-to-html@1.0.3

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@iarna/rtf-to-html

Convert RTF to HTML in pure JavaScript.

const rtfToHTML = require('@iarna/rtf-to-html')

fs.createReadStream('example.rtf').pipe(rtfToHTML((err, html) => {
  // …
})
rtfToHTML.fromStream(fs.createReadStream('example.rtf'), (err, html) => {
  // …
})
rtfToHTML.fromString('{\\rtf1\\ansi\\b hi there\\b0}', (err, html) => {
  console.log(html)
  // prints a document containing:
  // <p><strong>hi there</strong></p>
})

This is built on rtf-parser and shares its limitations.

This generates complete HTML documents from RTF documents. It does not currently have the facility to work on snippets of either.

Supported features:

  • Paragraph detection (results in <p> tags) plus empty paragraph trimming.
  • Font (as font-family: Font Name, Font Family). Font families in RTF don't map perfectly to HTML. This is the mapping we currently use:
    • roman: serif
    • swiss: sans-serif
    • script: cursive
    • decor: fantasy
    • modern: sans-serif
    • tech: monospace
    • bidi: serif
  • Font size (as font-size: #pt)
  • Bold (as <strong>)
  • Italic (as <em>)
  • Underline (as <u>)
  • Strikethrough (as <s>)
  • Superscript (as <sup>)
  • Subscript (as <sub>)
  • Foreground color (as color: rgb(#,#,#))
  • Background color (as color: rgb(#,#,#))
  • Paragraph first-line indents (as text-indent: #pt)
  • Idented regions (as padding-left: #pt)
  • Text alignment: left, right, center, justify (as text-align:)

FAQs

Package last updated on 21 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc