The center for all Wikitravel images!

Tech:Listing location and line feeds

From Wikitravel Shared
Jump to: navigation, search

What happens[edit]

This is actually two bugs:

  1. New listings are always places at the beginning of a section, often butting above any introductory text. Instead, they should go to the end. (Or better yet, get alphabetized, but this is probably Hard(tm).)
  2. If a user hits Enter at the end of a listing description more than once, that gets stored as well, and then the [Edit] link is pushed all alone onto the next line like this:

Sample. Yabbadabbadoo!  edit

When it happens[edit]

What should happen[edit]

How to fix it[edit]

For number 2, trimming whitespace before printing should do the trick.

Additional comments[edit]

At end exactly. But no аutomatic sort of any kind! There are many sort may be used: a impotance, a price, a landmarks along some street etc. Moreover, a images sort most likely should be correspond with a listing item sort. Automatic sort will jam a ton of manual work. -- Sergey kudryavtsev 09:53, 10 June 2008 (EDT)

Sign below, please[edit]

Solution[edit]

2) This ended up being a more more complicated. Mediawiki tag substitution occurs before it does the block break down. If there are newlines in the tag content MW will treat them as a list item break (and, if there are two, a paragraph break) and insert the close list item html. Because of where this occurs in tag html it results in broken html and unpredictable behavior in the JS editor (which assumes that the html for the tag has a certain format). To avoid this I automatically remove all newlines from the description text before render. The description probably shouldn't be so long as to need paragraph formatting anyway. This is working on review and I'll push it live once I get some other listing editor items fixed. KevinSours 15:31, 19 August 2008 (EDT)


This should be done (and #1 is also fixed as best we can do) KevinSours 16:57, 27 August 2008 (EDT)

Variants

Actions

In other languages