What is the best method to change this object
{
src: \'img.jpg\',
title: \'foo\'
}
into a valid HTML tag string like t
Making html elements based out of objects containing attribute-attribute values such as
{
src: 'img.jpg',
title: 'foo'
}
almost completely falls into the paradigm of cook.js.
The command which you would issue with cook would be:
img ({
src: 'img.jpg',
title: 'foo'
})
If the attribute details are stored as given in your example,
in a variable obj
then:
img(obj)
For more details check it out at cook.relfor.co.