Я наконец нашел, как это сделать с помощью этого сценария: https://github.com/nicinabox/shortcode.js
Вот мой код для обработки моего дела:
new Shortcode(document.querySelector('body'), {
a: function(done) {
var ret='<a';
if (typeof this.options.href !== 'undefined' && this.options.href !== null) ret+=' href="'+this.options.href+'"';
if (typeof this.options.class !== 'undefined' && this.options.class !== null) ret+=' class="'+this.options.class+'"';
if (typeof this.options.title !== 'undefined' && this.options.title !== null) ret+=' title="'+this.options.title+'"';
if (typeof this.options.style !== 'undefined' && this.options.style !== null) ret+=' style="'+this.options.title+'"';
if (typeof this.options.target !== 'undefined' && this.options.target !== null) ret+=' target="'+this.options.title+'"';
ret+='>'+this.contents+'</a>';
return ret;
}
});