Last modified: 2013-08-15 19:29:05 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T39617, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37617 - Do not convert text marked as being in another language with a lang attribute
Do not convert text marked as being in another language with a lang attribute
Status: NEW
Product: MediaWiki
Classification: Unclassified
Language converter (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: C. Scott Ananian
:
Depends on:
Blocks: 37338
  Show dependency treegraph
 
Reported: 2012-06-15 02:22 UTC by Robin Pepermans (SPQRobin)
Modified: 2013-08-15 19:29 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Robin Pepermans (SPQRobin) 2012-06-15 02:22:51 UTC
Liangent had the idea to make LanguageConverter check for lang attributes in the page content, and disable conversion for those pieces of text, similar to how -{}- disables conversion.
This would avoid e.g. <span lang="ja">-{...}-</span> which is double work, certainly when extensions have to disable conversion.
Comment 1 Liangent 2012-06-15 14:43:01 UTC
In LanguageConverter::autoConvert, I see code snippet:

		// disable convert to variants between <code></code> tags
		$codefix = '<code>.+?<\/code>|';
		// disable convertsion of <script type="text/javascript"> ... </script>
		$scriptfix = '<script.*?>.*?<\/script>|';
		// disable conversion of <pre xxxx> ... </pre>
		$prefix = '<pre.*?>.*?<\/pre>|';

Maybe we want to replace these with a real parser, for easier implementation of the wanted feature in this bug.
Comment 2 Liangent 2012-06-15 14:56:59 UTC
Another way: I believe there're some HTML parsers inside wikitext parser, to remove harmful attribs. Maybe we can add some markNoConversion calls when it sees elements with other lang="".
Comment 3 Liangent 2012-11-28 05:53:56 UTC
See bug 42490 comment 1.
Comment 4 C. Scott Ananian 2013-08-15 18:51:01 UTC
Sure, I'll take this for now.  If/when I write the parsoid language converter, it would be straightforward to fix this.  Fixing it in PHP is harder...

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links