Camen Design Forum

How would you write Morse in HTML?

append delete Martijn

Very short questions: how would you mark-up Morse code in HTML? What symbols would you use?

Google didn’t turn up any good results to the next thing I did was open up Wikipedia (secure.wikimedia.org/…. They often give examples and they need to mark them up.

Wikipedia constantly uses · (U+00B7, middle dot) for dots but uses - (U+002D, hyphen-minus), – (U+2013, en dash) and — (U+2014, em dash) as dashes on different occasions. This brings up the question, what is the correct symbol for a dash?

The next big question is gaps. According to Wikipedia (secure.wikimedia.org/…) there are 3 types of gaps. Inter-element, short and medium. Should these be taken into account? If so, how?

A dot represents 1 unit and a dash 3. The middle dot symbol takes roughly the space of a default space symbol. This means the inter-element gap can simply be defined as a non-breaking space. From there it gets tough.

If we define a dash as an em dash then we have defined an em dash as being 3 units. The 3 unit long short gap can be an em space.

This leaves the medium gap (7 units) undefined. Maybe there is another space character that could be used instead? Or maybe it should be done in a whole different way?

Does Morse go in a CODE, PRE or some completely different element?

Let me hear your thought and semantic bickering.

Post scriptum: If any of the above stopped making sense I apologise. It’s mostly random thoughts written down.

Reply RSS

Replies

append delete #1. Martijn

Post post scriptum: first link should read secure.wikimedia.org/…

append delete #2. theraje

I would guess it depends on context. For example, a long message might be better coded using shorter dahs. I've seen some (mainly ASCII messages) using . as dits, and - as dahs.

In other words, use whatever best fits the situation. I mean, Morse code is just dits and dahs, and IIRC the visual representations of those are simply a tool to aid in understanding, or when actual Morse code is not practical (i.e. in a written document).

append delete #3. theraje

Oh, and as far as pauses go, I've always seen those in ASCII as spaces.

append delete #4. Kroc

em-dashes are good because they are extra long and visible. They are also designed to indicate a long parenthetical pause. So, middots and em-dashes are how I would go.

You could use shy-spaces if you wanted "non-spaces", as it were.

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn