Azure Jane Lunatic (azurelunatic) wrote in suggestions,
Azure Jane Lunatic

RTE handling pasted usernames

RTE handling pasted usernames

Short, concise description of the idea
When you paste a copied LiveJournal username into the Rich Text Editor, the Rich Text Editor should recognize it and treat it as a username.

Full description of the idea
When you copy text containing usernames and paste it into the Rich Text Editor, the usernames turn into so much HTML. This can be really awkward when you're trying to work on the entry in HTML mode later, and burns through about ten times as many characters as you'd need to just do the <lj user=""> tag.

LJ has to have on file, somewhere, the pattern of code it uses to build the HTML for the usernames. It should therefore be not horribly horribly impossibly hard to build something that recognizes the current pattern in which LJ serves a username (the details of how LJ displays the username may change over the years, but the concept that LJ builds it and therefore should recognize it stays the same). Then it's just a matter of extracting the username, wrapping the username the <lj user=""> code, and inserting it into the RTE in the proper place, at speed, and without screwing anything else up.

Also/originally proposed by me on Dreamwidth.

An ordered list of benefits
  • Less space used in entries made via the RTE, which is a big concern.
  • More intuitive to LiveJournal users
  • HTML editor will display the expected code if you switch back over after using the RTE, to create or to edit
  • Posted usernames are unlikely to break as LJ's server-side rendering of the user tags into proper HTML changes over the years (remember when copying and pasting the HTML from a username resulted in general brokenness?)
  • If the thing does not recognize an out of date username format as a usernam, it should leave it alone, and at least it (hopefully) should be valid HTML.
An ordered list of problems/issues involved
  • This may not be a common scenario
  • It will take a lot of doing
  • Someone could still have a page featuring usernames rendered with old code, and the old code could break and/or confuse the RTE. (Someone is unlikely to have a page loaded in their browser that they haven't refreshed for long enough to have the username build change, and less likely to then copy it and stick it in the RTE, but they could. More likely is that someone saved an HTML copy of a page.)
  • Anything done to the RTE is likely to make the whole shebang break
Tags: entry editor, entry editor: rich text, lj-specific markup, § no status
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded