display | more...

I GOT IN A FIGHT WITH MY LAWNMOWER

So, I was sitting there, wondering, what's the difference between <strong> and <b>. Then, I reread (for the zillionth time) N-Wing's informative writeup, E2 HTML Tags. So, says N-Wing, about <strong> and <em>, these are better? Cool, I think, and run off to the E2 Text Formatter to write my next writeup, On The Possibility, Origin, and Likelihood of a Higher Entity or Entities. The title should be in bold, I think, so I put asteriks around it. But, alas, the text formatter uses <b> tags! Oh no, I think, for N-Wing has told me that <b> tags are evil! This formatter must be able to use <strong> and <em> tags! It must be so, for N-Wing has told me so!

<mblase> If you have any problems, comments, or whatnot, send a /msg to mblase.

So, I think, I must /msg mblase to make this text formatter support <strong> and <em> tags. This will fix all my worries! This will (almost) save the world! So /msg mblase I do.

Paraphrased:
(r) mblase says It should support both sets of tags since some users have a preference.

This is true, I think. For N-Wing and I like <strong> and <em>, but what if mblase likes <strong> and <i>? So then, I set off on my quest to expand the Text Formatter which is in a language I barely even remember. After a while, the following stuff appears in front of me: (Changes are in bold. See the original Text Formatter code for more.)


<input type="checkbox" name="usestrong"> Use <strong>&lt;strong&gt;</strong> instead of <b>&lt;b&gt;</b>


<input type="checkbox" name="useem"> Use <em>&lt;em&gt;</em> instead of <i>&lt;i&gt;</i>

// get EM vs. I, B vs. STRONG preference if (myform.useem.checked) { var em = "true"; } else { var em = "false"; } if (myform.usestrong.checked) {var strong = "true"; } else { var strong = "false"; }


// add text styles for (var i=0; i<myform.slashed.length; i++) { var myradio = getRadio("slashed", i); if (myradio.checked) { if (myradio.value == "b") { if (strong == "true") { myradio.value = "strong"; } } if (myradio.value == "i") { if (em == "true") { myradio.value = "em"; } } text = addStyles("\\/", myradio.value, text); } } for (var i=0; i<myform.starred.length; i++) { var myradio = getRadio("starred", i); if (myradio.checked) { if (myradio.value == "b") { if (strong == "true") { myradio.value = "strong"; } } if (myradio.value == "i") { if (em == "true") { myradio.value = "em"; } } text = addStyles("\\*", myradio.value, text); } } for (var i=0; i<myform.underlined.length; i++) { var myradio = getRadio("underlined", i); if (myradio.checked) { if (myradio.value == "b") { if (strong == "true") { myradio.value = "strong"; } } if (myradio.value == "i") { if (em == "true") { myradio.value = "em"; } } text = addStyles("_", myradio.value, text); } }

It works!! Unfortunately, there's a problem. The problem such that, once you decide to use <strong> instead of <b> and/or <em> instead of <i>, you cannot change back until you reload/refresh the page. Since I sort of half-coded, half-guessed, I'm really lucky it works as much as it does. But, I don't have the slightest idea where the problem is! But, basically, it works... Still, how do I fix it!! I must know! But, alas, I do not. Anybody got any ideas?


PS: Yes!!! I finally get to use that Edevify! button!!

This mod would be easy enough to add to the Magical Text Formatter (which is always more up-to-date than the public Text Formatter), but it begs the question of usefulness. Why do people use the longer STRONG and EM tags instead of B and I? Because logical styles are more CSS-friendly than literal ones -- you can stylesheet up STRONG to do anything you want, i.e. italics and larger font with no bold. You can do the same with B, but it's less "logical" -- a bold tag should embolden, and nothing else.

However, what reason could there be to employ STRONG but still I, or EM with B, on this site? STRONG is still rendered as bold on E2's stylesheet, and EM is always rendered in italics. Choosing between one or the other is a choice between logical and literal styles, but it has no effect on how the writeup is presented to readers. That being the case, you may as well choose between all-logical or all-literal. Choosing both is worse than choosing "wrong."

Combining STRONG and EM into the same checkbox is just a space-saving measure in a document which is already longer than I'd like, even though it's no longer than is necessary. If other Edevers think this is worth adding, then it'll certainly be easy for me to add. But without a little more support, and knowing that the vast majority of E2 users prefer the shorter literal tags anyhow, I feel it's a lesser evil to leave the two options combined into one.

Log in or register to write something here or to contact authors.