Commit graph

7 commits

Author SHA1 Message Date
Bartosz Dziewoński 98a1bb09c0 Centralize Parsoid resource name parsing logic
Let's keep the ugly regexp and the comments about why we do this in a
single place.

This is mostly without behavior changes, with three exceptions:
* ve.dm.MWImageModel#attachScalable now passes a title with spaces
  instead of underscores to the Scalable (this doesn't matter because
  it's normalized to use spaces later anyway).
* ve.dm.MWImageNode#getFilename now returns a title with spaces
  instead of underscores. This is used in some API queries and when
  rendering thumbnails for missing files, and this format is actually
  more correct for both of these.
* ve.dm.MWTemplateModel now URI-decodes the template title. This
  actually fixes a bug where trying to edit a template transclusion
  whose title contains a '?' would throw an exception about invalid
  title.

Also, clarify that the return value of ve.dm.MWImageModel#getFilename
and ve.dm.MWImageNode#getFilename is different :(

Change-Id: I8e09015cea82308017ed925ec755b7231518126e
2018-02-28 03:01:05 +01:00
Ed Sanders 9770c80615 Load modules for preview
Bug: T147702
Change-Id: I94f6bdf122d4e2c9fba3103f36c438980ce8228d
2018-01-29 22:35:00 +00:00
James D. Forrester 0a7a845a42 doc: Bump copyright year
Change-Id: I0b299c840ede1a1b8552cecfc70c5760ab036181
2018-01-03 17:45:07 +00:00
C. Scott Ananian b85caca493 Strip legacy section IDs from inside headings
We emit <span id="..." typeof="mw:FallbackId"></span> inside headings
when necessary to provide backward compatibility with pre-HTML5
section ids.  These are mostly harmless inside VE --- they become hidden
alienated nodes, which are then safely ignored by Parsoid during html2wt
even if they manage to migrate outside of a heading --- but it's a
little safer to strip them.

Change-Id: I07d0fcf54427ab02d4930cff183d3e5579a99306
2017-12-12 12:15:05 -05:00
Ed Sanders 267d60f61a Unwrap Parsoid sections
Section wrapping will be introduced in I0f4c19f7.

Change-Id: I43ced131d07a20318af37e830318e30db2eb451f
2017-11-23 12:19:57 +00:00
James D. Forrester 122f49b2dd build: Bump file copyright notices for 2017
Change-Id: I3c20809e71cc0da58123e1b5f29c4f3aac945496
2017-01-03 08:58:33 -08:00
David Chan 367bc2437f New decodeURIComponentIntoArticleTitle method
This replaces ve.safeDecodeURIComponent(...).replace( /_/g, ' ' ) . This action
is really specific to the quirks of mediawiki title processing.

Change-Id: Ia9e525c9340e6de9e485355899996c97867ccb48
2016-06-14 23:31:23 +01:00