diff options
author | Ariel Constenla-Haile <arielch@apache.org> | 2013-03-23 12:49:10 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-12 17:07:54 +0100 |
commit | bc0e857b9699bfefa2d8204fe627063675c9cfc9 (patch) | |
tree | b689f2bc152eb611c683a57de0f7b720887ee790 /swext | |
parent | 55c63ccfd460895af22e91979967cec15d80b72d (diff) |
Resolves: #i121907# upgrade odt2mediawiki to latest version
upstream changed license to ALv2
Besides the license change, there are two bug fixes:
* Do not apply any transformation to the contents marked as WikiMath.
* Join sibling nodes marked as WikiMath.
Patch by: Bernhard Haumacher
(cherry picked from commit 414a61fa4c4f03a2b2645682c55ee56ae9c84a79)
Change-Id: I6b996631ebdd908c6d96d2c9dde1a3d6dd3e212f
Diffstat (limited to 'swext')
-rw-r--r-- | swext/mediawiki/src/filter/odt2mediawiki.xsl | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/swext/mediawiki/src/filter/odt2mediawiki.xsl b/swext/mediawiki/src/filter/odt2mediawiki.xsl index 845a11afa796..6a44ecdd581f 100644 --- a/swext/mediawiki/src/filter/odt2mediawiki.xsl +++ b/swext/mediawiki/src/filter/odt2mediawiki.xsl @@ -1,22 +1,21 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + odt2mediawiki: OpenDocument to WikiMedia transformation + Copyright (C) 2007-2013 Bernhard Haumacher (haui at haumacher dot de) -<!-- - odt2wiki: OpenDocument to WikiMedia transformation - Copyright (C) 2007 Bernhard Haumacher (haui at haumacher dot de) + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + http://www.apache.org/licenses/LICENSE-2.0 - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + $Id: odt2mediawiki.xsl 3180 2013-03-17 16:00:43Z hauma $ --> <stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform" @@ -478,12 +477,31 @@ == WikiMath == --> + <!-- + Make sure to join sibling node that are all formated with WikiMath style without repeating + the <math>..</math> markup. + + Do not apply any transformation to the contents marked as WikiMath. + --> <template match="text:span[@text:style-name='WikiMath']"> <value-of select="'<math>'"/> - <apply-templates/> + <value-of select="string(.)"/> <value-of select="'</math>'"/> </template> + <template match="text:span[@text:style-name='WikiMath' and boolean(preceding-sibling::node()[position()=1 and local-name(.)='span' and @text:style-name='WikiMath'])]"> + <value-of select="string(.)"/> + <value-of select="'</math>'"/> + </template> + + <template match="text:span[@text:style-name='WikiMath' and boolean(following-sibling::node()[position()=1 and local-name(.)='span' and @text:style-name='WikiMath'])]"> + <value-of select="'<math>'"/> + <value-of select="string(.)"/> + </template> + + <template match="text:span[@text:style-name='WikiMath' and boolean(following-sibling::node()[position()=1 and local-name(.)='span' and @text:style-name='WikiMath']) and boolean(preceding-sibling::node()[position()=1 and local-name(.)='span' and @text:style-name='WikiMath'])]"> + <value-of select="string(.)"/> + </template> <!-- == Native links == |