
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
html-to-pptxgenjs-parser
Advanced tools
Fork from https://github.com/it-beyondit/html2pptxgenjs to Convert HTML into PptxGenJS text
html-to-pptxgenjs-parser provides a simple API for converting HTML into PptxGenJS text. It runs in both Node.js and a web browser.
Install with npm
:
npm install html-to-pptxgenjs-parser
html-to-pptxgenjs-parser parses and HTML snippet and converts it into a list of items that can be then used with addSlide()
.
let slide = pres.addSlide();
const items = parser.htmlToPptxText('Hello, <b>world</b>!');
slide.addText(items, { x: 0.5, y: 0, w: 9.5, h: 6, valign: 'top' });
Check demo.js
for a short example of actual usage.
html-to-pptxgenjs-parser provides a simple API for converting HTML into PptxGenJS text. It supports the most common and useful HTML tags, as well as basic styling using CSS and inline styles.
The following tags are supported:
<a>
: hyperlink
href
= target URLtitle
= title<b>
: bold<b>
: line break<del>
: strikethrough (same as <s>
)<font>
: font
color
: colorface
: face, e.g. "Arial"size
: size (see Size)<h1>
...<h6>
: header<i>
: italic<em>
: also italic<ol>
: ordered list<p>
: paragraph (see Options)<pre>
: preformatted text (see Options)<s>
: strikethrough<strike>
: strikethrough (same as <s>
)<sub>
: subscript<sup>
: superscript<u>
: underline<ul>
: unordered listAny other tag such as for example span
or div
can be used to wrap text and possibly set attributes, but these tags have no special meaning.
All elements support the following attributes:
align
: text alignment, can be "Left", "Center" or "Rightstyle
: stylesheet rules for the current element (see Styles)html-to-pptxgenjs-parser offers basic support for styling using CSS (see Options) and inline styles, also when running in Node.js.
The following properties are supported:
background
: background color onlybackground-color
: background colorcolor
: colorfont-family
: font face, e.g. "Arial"font-size
: font size (see Size)font-style
: supports only "italic"font-weight
: can be used to set normal or bold (intermediate values become one of these two)margin
: margin, has to be a single value (see Size)text-align
: horizontal alignmenttext-shadow
: text shadowSize is specified in points, e.g. 12pt
.
The following units are also supported and converted to points:
%
: relative (in percentage) to the font size of the parent elementem
: relative to the current font sizerem
: relative to the font size or the root elementA few common shortcuts are supported as well, and automatically converted to points:
1
to 7
, as used in the font
elementxx-small, x-small, small, medium, large, x-large, xx-large
, gradually going from half to twice the current font sizeAn optional object can be used to specify the CSS and other options:
const options = {
css: '.world { color: blue; }',
fontSize: 20
}
let slide = pres.addSlide();
const items = parser.htmlToPptxText('Hello, <span class="world">world</span>!', options);
slide.addText(items, { x: 0.5, y: 0, w: 9.5, h: 6, valign: 'top' });
The following properties are supported:
css
: a list of CSS rulesfontFace
: initial font face, defaults to "Arial"fontSize
: initial font size in points, defaults to 12paraSpaceAfter
: vertical space after a paragraph, in pointsparaSpaceBefore
: vertical space before a paragraph, in pointspreFontFace
: font face for preformatted text, defaults to "Courier New"FAQs
Fork from https://github.com/it-beyondit/html2pptxgenjs to Convert HTML into PptxGenJS text
We found that html-to-pptxgenjs-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.