BaseMax / TinyTagEngineJS
Javascript: Sometimes you need to get input from the user that contains the symbols you want to tag, and render these tags.
README
Tiny TagEngine JS
Sometimes you need to get input from the user that contains the symbols you want to tag.
By this tiny library you are able to convert input text into your own tags and renders these.
It can be used in React/Vuejs as well, although the example I implemented has been implemented in Pure JS.
Input
[feature:1]
[feature:2][mine:1234][your:hi][slider:12123][myown:234234]...
Hello!
Output
...
Hello!
Demo
If you are going to test and watch a demo, the demo available online on: https://basemax.github.io/TinyTagEngineJS/example.html
Using
If you are going to use .js script on GitHub, you can use https://raw.githubusercontent.com/BaseMax/TinyTagEngineJS/main/tag-engine.js url.
Load this:
And next:
const input = `[feature:1]
[feature:2][mine:1234][your:hi][slider:12123][myown:234234]...
Hello!
`;
const res = tag_engine(input, {
"feature": (id) => ``,
"slider": (id) => ``,
"myown": (id) => ``,
"your": (id) => ``,
"mine": (id) => ``,
});
console.log(res);
© Copyright Max Base, 2021

