# Revisting Underline & Healthcare Documents

**URL:** <https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078>\
**Category:** Spec\
**Created:** [February 13, 2019, 10:22am UTC](https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078 "2019-02-13T10:22:43Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![grahamegrieve](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/grahamegrieve/32/1492_2.png) [@grahamegrieve](https://talk.commonmark.org/u/grahamegrieve)\
**Post date:** [February 13, 2019, 10:22am UTC](https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078/1 "2019-02-13T10:22:43Z")

</div>

I am project lead for FHIR, a widely endorsed specification developed by HL7 for the exchange of healthcare information ([http://hl7.org/fhir](http://hl7.org/fhir)). We are trying to converge the healthcare community on using CommonMark for rich text. One of the challenges we have with this is that CommonMark does not support underline. I’ve read [Feature Request: underline text](https://talk.commonmark.org/t/feature-request-underline-text/343), and I understand the theoretical reasons why underlining has problems, but replacing the practice of underlining with some other text decoration is not a simple thing - people have been underlining text for a long time, and existing healthcare documents make heavy use of underling. In a few cases, the text will explicitly referenced ‘underlined text’, or existing clinical protocols will do so, but new software based on markdown instead of RTF cannot support the clinical protocol.

I’m not sure how to progress this. If CommonMark doesn’t and won’t support underline, we could define our own extension, but that has very obvious downsides, and we don’t want to do that. Alternatively, GFM could, because we’re actually using GFM, for strikethrough (critical for healthcare documents). Otherwise… maybe any consensus to use commonmark might be impossible (? not sure, but clinical users feel extremely strongly about text fidelity).

An aside: text color is also a problem, but since most systems have not supported color, and because of color blindness, color is used and depended on a lot less.

---

<div class="post-metadata">

**Author:** ![jgm](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/jgm/32/1360_2.png) [@jgm](https://talk.commonmark.org/u/jgm)\
**Post date:** [February 13, 2019, 6:21pm UTC](https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078/2 "2019-02-13T18:21:01Z")

</div>

What exactly do you need? Do you need to write texts  
that contain both underline and italic emphasis? Or  
is it sufficient if emphasized words are _rendered_  
underlined?

In the latter case, nothing needs to change in  
commonmark parsing; you just need to change the  
renderer slightly to make `*hello*` come out underlined.

---

<div class="post-metadata">

**Author:** ![Crissov](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/crissov/32/1455_2.png) [@Crissov](https://talk.commonmark.org/u/Crissov)\
**Post date:** [February 13, 2019, 9:56pm UTC](https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078/3 "2019-02-13T21:56:57Z")

</div>

Distinguishing `_foo_` from `*foo*` in the AST would help extensions. Otherwise, I would suggest to use a sequence of four characters: ` ****foo**** `.

---

<div class="post-metadata">

**Author:** ![chrisalley](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/chrisalley/32/906_2.png) [@chrisalley](https://talk.commonmark.org/u/chrisalley)\
**Post date:** [February 14, 2019, 12:31am UTC](https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078/4 "2019-02-14T00:31:34Z")

</div>

@grahamegrieve In HTML5, the `<u>` element represents an [Unarticulated Annotation](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/u). Would you consider this definition to be your use case?

If you’re referencing the underlined text as underlined elsewhere in the document then it’s meaningful beyond mere presentation and there probably needs to be a way making this portable between implementations. It’s similar to referencing an item in a letter ordered list; the meaning of the document changes if the list item type is changed in CSS, so there’s an attribute to define this in HTML.

---

<div class="post-metadata">

**Author:** ![grahamegrieve](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/grahamegrieve/32/1492_2.png) [@grahamegrieve](https://talk.commonmark.org/u/grahamegrieve)\
**Post date:** [February 14, 2019, 11:36am UTC](https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078/5 "2019-02-14T11:36:36Z")

</div>

> [@jgm](#):
>
> Do you need to write texts  
> that contain both underline and italic emphasis?

ahh yes, Clinicians have been using both bold and underline for many years in their reports

---

<div class="post-metadata">

**Author:** ![grahamegrieve](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/grahamegrieve/32/1492_2.png) [@grahamegrieve](https://talk.commonmark.org/u/grahamegrieve)\
**Post date:** [February 14, 2019, 11:39am UTC](https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078/6 "2019-02-14T11:39:50Z")

</div>

\<u\> approximates the use case, yes.

In terms of references, some thing like this may be encountered in clinical narrative (real world sample):

“Based on the serious problems (see underlined text above), I discussed…”

---

<div class="post-metadata">

**Author:** ![grumer](https://cdn.commonmark.org/letter_avatar_proxy/v2/letter/g/ecccb3/32.png) [@grumer](https://talk.commonmark.org/u/grumer)\
**Post date:** [February 14, 2019, 11:48am UTC](https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078/7 "2019-02-14T11:48:44Z")

</div>

@grahamegrieve Is there a reason why markdown instead than asciidoctor? While it doesn’t support underline directly, it supports using custom inline and block elements, for example `[.underline]#underlined text#`.

---

<div class="post-metadata">

**Author:** ![jgm](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/jgm/32/1360_2.png) [@jgm](https://talk.commonmark.org/u/jgm)\
**Post date:** [February 14, 2019, 5:23pm UTC](https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078/8 "2019-02-14T17:23:12Z")

</div>

I had a quick look at your project. It looks like an XML format. I would think that the most natural representation of rich text in that format would be something XML-ish – perhaps HTML, or some custom subset. Commonmark could be used in the tooling for creating records, etc., but is it the best choice for the underlying representation?

Note also that this is perfectly valid commonmark, since you can include raw HTML tags:

```auto
This text is <u>underlined</u>.

```

---

<div class="post-metadata">

**Author:** ![grahamegrieve](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/grahamegrieve/32/1492_2.png) [@grahamegrieve](https://talk.commonmark.org/u/grahamegrieve)\
**Post date:** [February 14, 2019, 10:36pm UTC](https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078/9 "2019-02-14T22:36:07Z")

</div>

So we have prohibited HTML tags since we really want the content limited to markdown for both security and presentation reasons. And we do use XHTML where XML is appropriate, but implementers have expressed a strong preference for markdown where possible. And we would probably never have used XHTML if commonmark had existed earlier. It’s very difficult for us to reference a non-standard in the standard (e.g. asciidoctor).

---

<div class="post-metadata">

**Author:** ![chrisalley](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/chrisalley/32/906_2.png) [@chrisalley](https://talk.commonmark.org/u/chrisalley)\
**Post date:** [February 15, 2019, 5:03am UTC](https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078/10 "2019-02-15T05:03:28Z")

</div>

In [Markua](https://leanpub.com/markua/read) they use four underscores for underlined text, e.g. ` ____my underlined text____ `. So that’s an option. I’m not sure that it’s easier to read than `<u>my underlined text</u>` though. In this case, it might be preferable to make an exception to your no-HTML rule. If we are going to make unarticulated annotations a CommonMark extension, I might begrudgingly agree to this syntax for compatibility reasons.

---

<div class="post-metadata">

**Author:** ![Brian\_Lalonde](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/brian_lalonde/32/1565_2.png) [@Brian\_Lalonde](https://talk.commonmark.org/u/Brian_Lalonde)\
**Post date:** [February 18, 2019, 10:19pm UTC](https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078/11 "2019-02-18T22:19:54Z")

</div>

Marking text as bold and italic would give you a way to style the generated HTML with CSS while still using standard CommonMark.

```
See ***underlined*** text below

```

The CSS would be something like:

```
em strong, strong em {text-decoration: underline; font-style: normal; font-weight: normal}
```

---

<div class="post-metadata">

**Author:** ![chrisalley](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/chrisalley/32/906_2.png) [@chrisalley](https://talk.commonmark.org/u/chrisalley)\
**Post date:** [February 19, 2019, 12:05am UTC](https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078/12 "2019-02-19T00:05:58Z")

</div>

Another solution is that you could use [consistent attribute syntax](https://talk.commonmark.org/t/consistent-attribute-syntax/272) which seems most likely be turned into a CommonMark extension. E.g.

```
[My underlined text.]{ .clinical-term }

```

Although this may seem long-winded, the advantage is that is separates the styling from the structure of the document. Even if you always made the clinical-term class appear underlined (to preserve the meaning where this is referred to), it gives you options in the future if you want to, say, make all clinical terms appear in red to diffentiate them from other underlined text.

---

<div class="post-metadata">

**Author:** ![grahamegrieve](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/grahamegrieve/32/1492_2.png) [@grahamegrieve](https://talk.commonmark.org/u/grahamegrieve)\
**Post date:** [February 19, 2019, 1:35am UTC](https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078/13 "2019-02-19T01:35:22Z")

</div>

Well, these are options - thanks. We’ll discuss it further. None of them are ideal, though I prefer \_\_\_. Does CommonMark have a formal process for extensions? I haven’t seen any process?

---

<div class="post-metadata">

**Author:** ![chrisalley](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/chrisalley/32/906_2.png) [@chrisalley](https://talk.commonmark.org/u/chrisalley)\
**Post date:** [February 19, 2019, 5:07am UTC](https://talk.commonmark.org/t/revisting-underline-healthcare-documents/3078/14 "2019-02-19T05:07:18Z")

</div>

I believe the plan is to release version 1.0 of the core spec before moving on to extensions.

In the Mozilla article I linked to above, did you have a look at the [other elements to consider using](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/u#Other_elements_to_consider_using) section? Any of those of elements can styled as underlined and one or more of them is likely better suited for your use case than `<u>`. Although not all of these elements can be found in the primary CommonMark spec, some have been [proposed as extensions already](https://github.com/commonmark/CommonMark/wiki/Proposed-Extensions). Maybe the [alternative mood/voice](https://talk.commonmark.org/t/alternate-voice-or-mood-i-tag-in-html5/1206) element which can be used for technical terms.
