Kaydet (Commit) bc0e857b authored tarafından Ariel Constenla-Haile's avatar Ariel Constenla-Haile Kaydeden (comit) Caolán McNamara

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 414a61fa)

Change-Id: I6b996631ebdd908c6d96d2c9dde1a3d6dd3e212f
üst 55c63ccf
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!--
odt2mediawiki: OpenDocument to WikiMedia transformation
Copyright (C) 2007-2013 Bernhard Haumacher (haui at haumacher dot de)
<!-- Licensed under the Apache License, Version 2.0 (the "License");
odt2wiki: OpenDocument to WikiMedia transformation you may not use this file except in compliance with the License.
Copyright (C) 2007 Bernhard Haumacher (haui at haumacher dot de) You may obtain a copy of the License at
This program is free software; you can redistribute it and/or modify http://www.apache.org/licenses/LICENSE-2.0
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.
This program is distributed in the hope that it will be useful, Unless required by applicable law or agreed to in writing, software
but WITHOUT ANY WARRANTY; without even the implied warranty of distributed under the License is distributed on an "AS IS" BASIS,
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
GNU General Public License for more details. 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 $Id: odt2mediawiki.xsl 3180 2013-03-17 16:00:43Z hauma $
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--> -->
<stylesheet version="1.0" <stylesheet version="1.0"
xmlns="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/XSL/Transform"
...@@ -478,12 +477,31 @@ ...@@ -478,12 +477,31 @@
== WikiMath == == 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']"> <template match="text:span[@text:style-name='WikiMath']">
<value-of select="'&lt;math&gt;'"/> <value-of select="'&lt;math&gt;'"/>
<apply-templates/> <value-of select="string(.)"/>
<value-of select="'&lt;/math&gt;'"/> <value-of select="'&lt;/math&gt;'"/>
</template> </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="'&lt;/math&gt;'"/>
</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="'&lt;math&gt;'"/>
<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 == == Native links ==
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment