Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
agenda-libre-quebec
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
facil
agenda-libre-quebec
Validations
24ff28b6
Valider
24ff28b6
rédigé
6 years ago
par
echarp
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
b and i tags also have their eventual inner spaces better managed
parent
2cc80127
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
app/helpers/events_helper.rb
+4
-3
4 ajouts, 3 suppressions
app/helpers/events_helper.rb
test/helpers/events_helper_test.rb
+1
-0
1 ajout, 0 suppression
test/helpers/events_helper_test.rb
avec
5 ajouts
et
3 suppressions
app/helpers/events_helper.rb
+
4
−
3
Voir le fichier @
24ff28b6
...
@@ -66,6 +66,7 @@ module EventsHelper
...
@@ -66,6 +66,7 @@ module EventsHelper
Kramdown
::
Document
.
new
(
spaces
(
desc
),
input: :html
,
line_width:
line_width
)
Kramdown
::
Document
.
new
(
spaces
(
desc
),
input: :html
,
line_width:
line_width
)
.
to_kramdown
.
to_kramdown
.
gsub
(
/\\([\"'])/
,
'\1'
)
# Remove slash before quotes
.
gsub
(
/\\([\"'])/
,
'\1'
)
# Remove slash before quotes
.
remove
(
/[[:blank:]]+$/
)
# Remove extraneous spaces
.
remove
(
/{::}/
)
# Markdown artefact
.
remove
(
/{::}/
)
# Markdown artefact
end
end
...
@@ -73,8 +74,8 @@ module EventsHelper
...
@@ -73,8 +74,8 @@ module EventsHelper
# Cleaner html elements, to correct things like <em> test</em>
# Cleaner html elements, to correct things like <em> test</em>
def
spaces
(
desc
)
def
spaces
(
desc
)
desc
.
gsub
(
/<(strong|em)> /
,
' <\1>'
)
desc
.
gsub
(
/<(strong|em
|b|i
)> /
,
' <\1>'
)
.
gsub
(
%r{ </(strong|em)>}
,
'</\1> '
)
.
gsub
(
%r{ </(strong|em
|b|i
)>}
,
'</\1> '
)
.
gsub
(
/
([,.])/
,
'\1'
)
.
gsub
(
/
[[:space:]]
([,.])/
,
'\1'
)
end
end
end
end
Ce diff est replié.
Cliquez pour l'agrandir.
test/helpers/events_helper_test.rb
+
1
−
0
Voir le fichier @
24ff28b6
...
@@ -16,5 +16,6 @@ class EventsHelperTest < ActionView::TestCase
...
@@ -16,5 +16,6 @@ class EventsHelperTest < ActionView::TestCase
assert_equal
'**h**,'
,
to_markdown
(
'<strong>h </strong>,'
)
assert_equal
'**h**,'
,
to_markdown
(
'<strong>h </strong>,'
)
assert_equal
'*ho***h**,'
,
to_markdown
(
'<em>ho</em><strong>h </strong>,'
)
assert_equal
'*ho***h**,'
,
to_markdown
(
'<em>ho</em><strong>h </strong>,'
)
assert_equal
'*ho* **h**,'
,
to_markdown
(
'<em>ho</em><strong> h</strong>,'
)
assert_equal
'*ho* **h**,'
,
to_markdown
(
'<em>ho</em><strong> h</strong>,'
)
assert_equal
'*ho* **h**,'
,
to_markdown
(
'<i>ho</i><b> h</b>,'
)
end
end
end
end
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter