Skip to content
Extraits de code Groupes Projets
Valider 124329b1 rédigé par bricebou's avatar bricebou
Parcourir les fichiers

feat: prise en charge des pseudo-listes... (#4677)

...c'est-à-dire a minima deux lignes successives commençant par "- ".
Ces pseudo-listes sont importées de telle sorte que SPIP les interprète ensuite comme des listes non ordonnées.

Fix: #4677
parent 1c3e5fab
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!4677feat: prise en charge des pseudo-listes... (#4677)
Ce commit fait partie de la requête de fusion !4677. Les commentaires créés ici seront créés dans le contexte de cette requête de fusion.
......@@ -250,14 +250,28 @@ intertitres_riches= <xsl:value-of select="$IntertitresRiches" />
</xsl:if>
</xsl:template>
<xsl:template match="text:p">
<!-- en cas de citation, ajout de la balise <quote> -->
<xsl:if test="(@text:style-name='Quotations' and preceding-sibling::text:p[1][not(starts-with(@text:style-name, 'Quotations'))]) or (@text:style-name='Quote' and preceding-sibling::text:p[1][not(starts-with(@text:style-name, 'Quote'))])"><xsl:text>&lt;quote&gt;</xsl:text></xsl:if>
<xsl:apply-templates/>
<xsl:if test="(@text:style-name='Quotations' and following-sibling::text:p[1][not(starts-with(@text:style-name, 'Quotations'))]) or (@text:style-name='Quote' and following-sibling::text:p[1][not(starts-with(@text:style-name, 'Quote'))])"><xsl:text>&lt;/quote&gt;</xsl:text></xsl:if>
<xsl:text >&#xA;&#xA;</xsl:text>
<xsl:if test="count(node())=0">
<xsl:text>&#xA;&#xA;</xsl:text>
</xsl:if>
<xsl:choose>
<!--
Prise en charge des pseudo-listes, c'est-à-dire au moins deux lignes successives débutant par "- ".
Ces pseudo-listes sont "transformées" en listes non ordonnées lors de leur import dans SPIP.
-->
<xsl:when test="starts-with(text(), '- ') and (preceding-sibling::text:p[1][starts-with(text(), '- ')] or following-sibling::text:p[1][starts-with(text(), '- ')])">
<xsl:text>-* </xsl:text>
<xsl:value-of select="substring-after(text(), '- ')" />
<xsl:apply-templates select="descendant::*" />
<xsl:text >&#xA;</xsl:text>
</xsl:when>
<xsl:otherwise>
<!-- en cas de citation, ajout de la balise <quote> -->
<xsl:if test="(@text:style-name='Quotations' and preceding-sibling::text:p[1][not(starts-with(@text:style-name, 'Quotations'))]) or (@text:style-name='Quote' and preceding-sibling::text:p[1][not(starts-with(@text:style-name, 'Quote'))])"><xsl:text>&lt;quote&gt;</xsl:text></xsl:if>
<xsl:apply-templates/>
<xsl:if test="(@text:style-name='Quotations' and following-sibling::text:p[1][not(starts-with(@text:style-name, 'Quotations'))]) or (@text:style-name='Quote' and following-sibling::text:p[1][not(starts-with(@text:style-name, 'Quote'))])"><xsl:text>&lt;/quote&gt;</xsl:text></xsl:if>
<xsl:text >&#xA;&#xA;</xsl:text>
<xsl:if test="count(node())=0">
<xsl:text>&#xA;&#xA;</xsl:text>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
......
<?xml version="1.0" encoding="UTF-8"?>
<office:document-content xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" office:version="1.3"><office:scripts/><office:font-face-decls><style:font-face style:name="Arial Unicode MS" svg:font-family="&apos;Arial Unicode MS&apos;" style:font-family-generic="swiss"/><style:font-face style:name="Arial Unicode MS1" svg:font-family="&apos;Arial Unicode MS&apos;" style:font-family-generic="system" style:font-pitch="variable"/><style:font-face style:name="Liberation Sans" svg:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/><style:font-face style:name="Liberation Serif" svg:font-family="&apos;Liberation Serif&apos;" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-face style:name="Songti SC" svg:font-family="&apos;Songti SC&apos;" style:font-family-generic="system" style:font-pitch="variable"/></office:font-face-decls><office:automatic-styles><style:style style:name="P1" style:family="paragraph" style:parent-style-name="Text_20_body"><style:text-properties officeooo:rsid="000ab54f" officeooo:paragraph-rsid="000ab54f"/></style:style><style:style style:name="T1" style:family="text"><style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/></style:style><style:style style:name="T2" style:family="text"><style:text-properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/></style:style><style:style style:name="T3" style:family="text"><style:text-properties fo:font-style="italic" fo:font-weight="bold" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-style-complex="italic" style:font-weight-complex="bold"/></style:style></office:automatic-styles><office:body><office:text><text:sequence-decls><text:sequence-decl text:display-outline-level="0" text:name="Illustration"/><text:sequence-decl text:display-outline-level="0" text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/><text:sequence-decl text:display-outline-level="0" text:name="Drawing"/><text:sequence-decl text:display-outline-level="0" text:name="Figure"/></text:sequence-decls><text:p text:style-name="Title">Test peudo-listes</text:p><text:p text:style-name="P1"/><text:p text:style-name="P1">L’idée est donc de prendre en charge les pseudo-listes ainsi construites :</text:p><text:p text:style-name="P1">- un premier item ;</text:p><text:p text:style-name="P1">- un deuxième item ;</text:p><text:p text:style-name="P1">- un troisième item.</text:p><text:p text:style-name="P1"/><text:p text:style-name="P1">Le formatage au sein de ces listes est bel et bien conservé :</text:p><text:p text:style-name="P1">- un premier item <text:span text:style-name="T1">avec un peu de gras</text:span> ;</text:p><text:p text:style-name="P1">- un deuxième item <text:span text:style-name="T2">avec un peu d’italique</text:span> ;</text:p><text:p text:style-name="P1">- un troisième item <text:span text:style-name="T3">avec un peu de gras italique</text:span>.</text:p><text:p text:style-name="P1"/><text:p text:style-name="P1">Par contre, attention, si les tirets « déclencheurs » font appel à un style, il ne seront pas pris en charge :</text:p><text:p text:style-name="P1">- un premier item <text:span text:style-name="T1">avec un peu de gras</text:span> ;</text:p><text:p text:style-name="P1"><text:span text:style-name="T2">-</text:span> un deuxième item <text:span text:style-name="T2">avec un peu d’italique</text:span> ;</text:p><text:p text:style-name="P1"><text:span text:style-name="T3">- </text:span>un troisième item <text:span text:style-name="T3">avec un peu de gras italique</text:span>.</text:p></office:text></office:body></office:document-content>
\ No newline at end of file
Fichier ajouté
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter