Do HTML tags make a difference? I made a fairly simple template engine (if I could call it that). Basically my server returns something like

string "This text should be [color:red;font-weight:bold; red and bold]"


Then on the client side I have my parser, for HTML in this case

function parse(str){
    return str.replace(/\[(.+?) (.+?)\]/g,'&lt;span style="$1"&gt;$2&lt;/span&gt;');
}


I was wondering, however, do HTML tags make a difference? If I were to use font instead of span, would I win/lose anything?

P.S.: I am aware that this regex may pick up something that wasn't meant to be parsed, but my application doesn't use these braces in texts it returns, so it is alright.
There are several advantages to writing proper HTML and using semantic tags. Instead of asking yourself "How should this look?" Ask yourself "What does this mean?".

What does it mean for a text to be red? Does it mean &lt;em&gt;phasized text? Maybe &lt;strong&gt; text? You can always apply the style="color: red;" on top of that (or even better, with a classname).

What are the advantages?


&lt;font&gt; is deprecated. Today it's still supported, mainly due to idiots who want their sites to run with IE5.5, but that may not be the case in the future. One day, &lt;font&gt; might just stop working altogether. Its behavior is currently undefined in latest versions of HTML, and will lead to unpredictable variations between browser implementations, and between browser versions.
Using proper elements (&lt;em&gt;, &lt;strong&gt; as opposed to &lt;span&gt; or &lt;font&gt;) makes machines understand your text better. That's good for accessibility, SEO, and a bunch of other things that entities which are not actual human readers do.
Using proper elements makes your site look better by default. Say a client does not use CSS, he's on a very old phone, or just uses some obscure browser. &lt;em&gt; shows up as italicized, &lt;strong&gt; shows up as bold. &lt;span&gt; shows up completely normally.




Other than that, if you're already defining all of the CSS rules in your template engine, why not use HTML to begin with? There's no point in complicating things with yet another syntax. Write valid, proper HTML from start to end, and be done with it.