Blog 1

Random Talk on Random Thoughts

Hyperlinks in Ordered Lists in Markdown in Vim

| Comments |

Background

Same as the one in my previous post.

I usually write hyperlinks for software names using only one pair of square brackets, like [Vim] instead of [Vim][Vim]. Even though this isn’t standard, this is more convenient.

Problem

I want to start the second item of the following ordered list with a hyperlink to textobj-lastpat written in a short but non-standard way.

Markdown source code of the ordered list (test-post.mkd) download
1
2
3
4
5
6
7
8
9
10
11
12
Lessons learnt
---

Moreover, I revised the usage of these two [Vim] plugins.

1. [Visual Star Search][visual-star-search]: Select text in visual
   mode and search it with an asterisk `*`.
2. [textobj-lastpat]: Add the last search pattern as a text object.

[Vim]: http://www.vim.org
[visual-star-search]: https://github.com/bronson/vim-visual-star-search
[textobj-lastpat]: https://github.com/kana/vim-textobj-lastpat

Unluckily, as I typed this Vim Ex command to see whether my Markdown syntax was correct, I quickly received an error from kramdown.

:!kramdown % > %<.html

You may click “donwload” at the top right hand corner of the codeblock below to see the effect of the result generated by ihe Markdown parser.

Generated HTML code of the ordered list (test-post.html) download
1
2
3
4
5
6
7
8
9
<h2 id="lessons-learnt">Lessons learnt</h2>

<p>Moreover, I revised the usage of these two <a href="http://www.vim.org">Vim</a> plugins.</p>

<ol>
  <li><a href="https://github.com/bronson/vim-visual-star-search">Visual Star Search</a>: Select text in visual
mode and search it with an asterisk <code>*</code>.</li>
  <li></li>
</ol>
Warning: Duplicate link ID 'textobj-lastpat' on line 13 - overwriting

Press ENTER or type command to continue

Solution

This time, I won’t find out what’s wrong from the error message because writing that hyperlink in the standard way is the quickest solution that I know.

Comments