Skip to content

Commit

Permalink
v2.1.7
Browse files Browse the repository at this point in the history
  - Added support for `<sup>` and `<sub>` (see issue #97)
  • Loading branch information
Aymkdn committed Apr 2, 2021
1 parent 0a1a67f commit e7ad746
Show file tree
Hide file tree
Showing 8 changed files with 3,480 additions and 541 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ The below HTML tags are supported:
- FONT
- IMG
- SVG
- SUP / SUB

### Default styles

Expand Down
2 changes: 1 addition & 1 deletion browser.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions example.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ var html = htmlToPdfMake(`
<div>And support for <font color="blue" size="3">FONT</font> tag.</div>
`, {window:window, tableAutoSize:true});

//var html = htmlToPdfMake(``, {window:window, tableAutoSize:true});
//console.log(JSON.stringify(html))
/*var html = htmlToPdfMake(``, {window:window, tableAutoSize:true});
console.log(JSON.stringify(html))*/

var docDefinition = {
content: [
Expand Down
Binary file modified example.pdf
Binary file not shown.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@ module.exports = function(htmlText, options) {
ret.text = [{text:'\n'}];
break;
}
case "SUB":
case "SUP": {
ret[nodeName.toLowerCase()] = { offset: '30%', fontSize: 8 };
break;
}
case "HR": {
// default style for the HR
var styleHR = {
Expand Down
Loading

0 comments on commit e7ad746

Please sign in to comment.