Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
anshu-krishna committed May 4, 2022
1 parent 05d9b95 commit f413d04
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# HTML-Tagged-Template-Literals [v3.0]
***This version is incompatible with the previous versions.***
# HTML-Tagged-Template-Literals [v3.0.1]

Using JavaScript `tagged template literals` for creating DOM Element trees.

The library provides a function named `HTML()` that can be used as [`string template tag`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates). It returns a `HTMLElement` | `TextNode` | `DocumentFragment`.

## Installation:
Import from: [https://cdn.jsdelivr.net/gh/anshu-krishna/HTML-Tagged-Template-Literals@3.0/html-ttl.min.js](https://cdn.jsdelivr.net/gh/anshu-krishna/HTML-Tagged-Template-Literals@3.0/html-ttl.min.js)
Import from: [https://cdn.jsdelivr.net/gh/anshu-krishna/HTML-Tagged-Template-Literals@3.0.1/html-ttl.min.js](https://cdn.jsdelivr.net/gh/anshu-krishna/HTML-Tagged-Template-Literals@3.0.1/html-ttl.min.js)
```javascript
import { HTML } from 'https://cdn.jsdelivr.net/gh/anshu-krishna/HTML-Tagged-Template-Literals@3.0/html-ttl.min.js';
import { HTML } from 'https://cdn.jsdelivr.net/gh/anshu-krishna/HTML-Tagged-Template-Literals@3.0.1/html-ttl.min.js';
```
## Examples:

Expand Down
2 changes: 1 addition & 1 deletion html-ttl.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function HTML(strings, ...exps) {
case 3:
{
let textNodes = item.value.split(splitPattern).map(n => document.createTextNode(n));
let e = item.node.parentElement;
let e = item.node.parentNode;
e.insertBefore(textNodes[0], item.node);
for (let i = 0, j = item.match.length; i < j; i++) {
let expNodes = nodify(exps[item.match[i].index]);
Expand Down
2 changes: 1 addition & 1 deletion html-ttl.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "html-tagged-template-literal",
"version": "3.0.0",
"version": "3.0.1",
"description": "A tagged template for creating HTML elements",
"author": "Anshu Krishna <anshu.krishna@gmail.com>",
"license": "MIT"
Expand Down

0 comments on commit f413d04

Please sign in to comment.