Skip to content
Snippets Groups Projects
Commit 9ce1d18a authored by Alexandre Caldato's avatar Alexandre Caldato
Browse files

ajout du strikethrough_replacer.js

parent 09a26b5c
Branches
Tags
No related merge requests found
...@@ -10,10 +10,6 @@ source files are written in Markdown, and configured with a single YAML ...@@ -10,10 +10,6 @@ source files are written in Markdown, and configured with a single YAML
configuration file. Start by reading the [introductory tutorial], then check the configuration file. Start by reading the [introductory tutorial], then check the
[User Guide] for more information. [User Guide] for more information.
[introductory tutorial]: getting-started.md
[User Guide]: user-guide/README.md
| Day | Breakfast | Lunch | Dinner | | Day | Breakfast | Lunch | Dinner |
|-----------|-------------------------|-----------------------|---------------------------| |-----------|-------------------------|-----------------------|---------------------------|
| Monday | Avocado Toast & Coffee | Grilled Chicken Salad | Spaghetti Carbonara | | Monday | Avocado Toast & Coffee | Grilled Chicken Salad | Spaghetti Carbonara |
...@@ -26,7 +22,7 @@ configuration file. Start by reading the [introductory tutorial], then check the ...@@ -26,7 +22,7 @@ configuration file. Start by reading the [introductory tutorial], then check the
--- ---
<del>Strikethrough text</del> ~~Strikethrough text~~
--- ---
...@@ -41,7 +37,6 @@ configuration file. Start by reading the [introductory tutorial], then check the ...@@ -41,7 +37,6 @@ configuration file. Start by reading the [introductory tutorial], then check the
--- ---
<div class="text-center"> <div class="text-center">
<a href="getting-started/" class="btn btn-primary" role="button">Getting Started</a> <a href="getting-started/" class="btn btn-primary" role="button">Getting Started</a>
<a href="user-guide/" class="btn btn-primary" role="button">User Guide</a> <a href="user-guide/" class="btn btn-primary" role="button">User Guide</a>
...@@ -125,3 +120,7 @@ Content for section 1 ...@@ -125,3 +120,7 @@ Content for section 1
## Section 2 ## Section 2
Content for section 2 Content for section 2
[introductory tutorial]: getting-started.md
[User Guide]: user-guide/README.md
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
rel="shortcut icon" href="{{ 'favicon/favicon.ico'|url }}"> rel="shortcut icon" href="{{ 'favicon/favicon.ico'|url }}">
<!-- 32×32 --> <!-- 32×32 -->
<link rel="manifest" href="{{ 'favicon/manifest.webmanifest'|url }}" crossorigin="use-credentials"> <link rel="manifest" href="{{ 'favicon/manifest.webmanifest'|url }}" crossorigin="use-credentials">
<script src="{{ 'js/strikethrough_replacer.js'|url }}" defer></script>
<!-- Modifier les chemins relatifs des favicons en fonction de la structure du projet --> <!-- Modifier les chemins relatifs des favicons en fonction de la structure du projet -->
<!-- Dans le fichier manifest.webmanifest aussi, modifier les chemins vers les images --> <!-- Dans le fichier manifest.webmanifest aussi, modifier les chemins vers les images -->
{# {% for path in config.extra_css %} {# {% for path in config.extra_css %}
...@@ -40,7 +41,7 @@ ...@@ -40,7 +41,7 @@
<body> <body>
{% include "header.html" %} {% include "header.html" %}
<main id="content" role="main"> <main id="content" role="main">
<div class="fr-container"> <div class="fr-container markdown-content">
<div class="fr-grid-row"> <div class="fr-grid-row">
{% if config.theme.menulateral %} {% if config.theme.menulateral %}
{% include "lateral.html" %} {% include "lateral.html" %}
...@@ -168,6 +169,7 @@ ...@@ -168,6 +169,7 @@
<script src="https://code.jquery.com/jquery-3.6.3.min.js" <script src="https://code.jquery.com/jquery-3.6.3.min.js"
integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU=" crossorigin="anonymous"></script> integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU=" crossorigin="anonymous"></script>
<script src="{{ 'js/base.js'|url }}" defer></script> <script src="{{ 'js/base.js'|url }}" defer></script>
<script src="{{ 'js/strikethrough_replacer.js'|url }}" defer></script>
{%- for path in extra_javascript %} {%- for path in extra_javascript %}
<script src="{{ path }}" defer></script> <script src="{{ path }}" defer></script>
{%- endfor %}#} {%- endfor %}#}
......
// JavaScript code pour remplacer le texte barré par du texte barré en HTML
document.addEventListener("DOMContentLoaded", function () {
// Sélectionne tous les éléments avec la classe markdown-content
const markdownElements = document.querySelectorAll(".markdown-content");
markdownElements.forEach((element) => {
let innerHTML = element.innerHTML;
// Remplace ~~texte~~ par <del>texte</del>
innerHTML = innerHTML.replace(/~~(.*?)~~/g, "<del>$1</del>");
element.innerHTML = innerHTML;
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment