I came across an odd behavior while using org-mode to create some web pages where list numbers get reset if you insert anchor tags. Consider the following example document:
* This is the first header line
1. This is line number 1
2. This is line number 2
3. This is line number 3
#<<Anchor1>>
1. This should be line number 4, but is reset by the anchor tag
2. This should be line number 5.
* This is the second header line
1. This is line number 1
2. This is line number 2
3. This is line number 3
#+BEGIN_HTML
<a name='anchor2'>
#+END_HTML
1. This stays line number 4
2. This stays line number 5
The numbers associated with the list items are the numbers created as new items are added automatically with ALT-ENTER. After the #<<Anchor1>> entry and the #+END_HTML, doing the Alt-Enter starts the list number back at 1. However, when this is exported to HTML, something else occurs. In the case of the #<<Anchor1>> entry, the HTML also restarts the list number, whereas with the #+BEGIN_HTML it does not. The generated HTML looks like the below. Notice in the first section the <ol> tag is closed and the anchor is wrapped with paragraph tags, then <ol> reopens, so there is a space as well as re-starting number, but in the second case the anchor tag is inline. Further down is the actual generated HTML text.
Shouldn't #<<anchor>> tags be treated in the same way as BEGIN_HTML/END_HTML?