Description
If you create a page with content in many lines instead of one line the wiki parser adds all those lines to one paragraph with different line ids. If you want to have different paragraphs you need to add an empty line.
e.g. typed like this in the text
This is a example And this is another example
This is a example
And this is another example
If you click on the second example line you get the right line in edit mode.
If you click on another example above you get the right line only because it is on the last line. Clicking anywhere in the pre-formatted text will position the cursor on the last line. The above example is broken on this page because of duplicate IDs -- clicking anywhere in the pre area positions the cursor on the H1 heading of Description (see MoinMoinBugs/DuplicateIdsOnSpanTags). Clicking within tables (try it on the table under Details below) has the same problem of always positioning the cursor on the last line of the table, a fix is attached below.
you found an other issue as i was intending to describe with my report. please create a new report and don't hijack this one. -- ReimarBauer 2010-04-08 19:10:06
The sentence above has more than one line id but clicking on any word in that line gives always line=1
Component selection
- general
Details
MoinMoin Version |
1.9.3pre |
OS and Version |
|
Python Version |
|
Server Setup |
|
Server Details |
|
Language you are using the wiki in (set in the browser/UserPreferences) |
|
Workaround
This does not fix the problem for predefined text, but fixes a similar problem for tables. I tried to attach a double-click event to the text nodes within pre-formatted text -- it failed with all browsers I tested. Clicking within a table row will position the cursor on the correct row if your browser is Firefox, Chrome, or Safari. If your browser is IE or Opera, the cursor will be positioned near the target row.
Deleted patch, better patch added to FeatureRequests/AutoScrollingTheEditorTextArea. -- RogerHaase 2010-04-12 20:27:33
Discussion
The js code just puts some js on the parent element of the line-id span. If some p has multiple line-ids, there is still just one handler.
This page has (or had before I started editing) duplicate IDs for line-1 through line-6. This may cause auto scroll to fail on some elements.
Some pages with preformatted test have line numbers like: <span class="anchor" id="line-2-1"> Is that a bug or intended behavior because of some recursive line numbering scheme?
Appears to be the desired behavior. The span tags with one number in the ID are stacked in front of the pre tag. Within the pre tag are span tags with two numbers separated by a -.
If I add ?action=SlideShow to this pages url and do view source, then the beginning of the body tag is shown below. Note the h1 has no span tag preceding or following it and is not double-clickable with the patched SlideShow.py (not available on this wiki). Firefox misses high by 1 line sometimes - not sure of the cause but slideshow pages with headings may be factor.
</head> <body> <h1> Description </h1> <div id="content"> <span class="anchor" id="line-1"></span> <p class="line874"> If you create a page with content in many lines instead of one line the wiki parser adds all those lines to one paragraph with different line ids. If you want to have different paragraphs you need to add an empty line. <span class="anchor" id="line-2"></span><span class="anchor" id= "line-3"></span> </p> <p class="line874"> e.g. <span class="anchor" id="line-4"></span><span class="anchor" id="line-5"></span><span class="anchor" id="line-6"></span><span class= "anchor" id="line-7"></span><span class="anchor" id="line-8"></span><span class="anchor" id="line-9"></span><span class="anchor" id= "line-10"></span><span class="anchor" id="line-11"></span> </p> <pre> <span class="anchor" id="line-1-1"></span>This <span class="anchor" id="line-2-1"></span>is <span class="anchor" id="line-3-1"></span>a
-- RogerHaase 2010-04-06 17:59:10
Plan
- Priority:
- Assigned to:
- Status: