We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have desingned if helps a function that convert an item with html subtags to html
use: extract(item.title);
function extract(item, tag = '') { if(typeof item === 'object') { if(Array.isArray(item)) { let content = ''; for(const i in item) { content = `${content} ${extract(item[i], tag)}`; } while(content[0] === ' ') content = content.substring(1); return content; } else { let attr = ''; let content = ''; for(const i in item) { if(i === '$') { for(const j in item[i]) { const value = item[i][j]; attr = `${attr} ${j}="${value}"`; }; } else if(i === '_') { content = `${content} ${item[i]}`; } else { content = `${content} ${extract(item[i], i)}`; } } while(content[0] === ' ') content = content.substring(1); if(tag !== '') return `<${tag}${attr}>${content}</${tag}>`; else return content; } } else if(typeof item === 'string') { if (tag !== '') return `<${tag}>${item}</${tag}>`; else return `${item}`; } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have desingned if helps a function that convert an item with html subtags to html
use: extract(item.title);
The text was updated successfully, but these errors were encountered: