crieur 1.8.1__tar.gz → 1.9.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of crieur might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crieur
3
- Version: 1.8.1
3
+ Version: 1.9.0
4
4
  Summary: A Static Revue Generator.
5
5
  Project-URL: Homepage, https://gitlab.huma-num.fr/ecrinum/crieur
6
6
  Project-URL: Issues, https://gitlab.huma-num.fr/ecrinum/crieur/-/issues
@@ -1,4 +1,4 @@
1
1
  from pathlib import Path
2
2
 
3
- VERSION = "1.8.1"
3
+ VERSION = "1.9.0"
4
4
  ROOT_DIR = Path(__file__).parent
@@ -15,7 +15,8 @@ from .typography import typographie
15
15
  from .utils import neighborhood
16
16
 
17
17
  locale.setlocale(locale.LC_ALL, "")
18
- md = mistune.create_markdown(plugins=["footnotes", "superscript"])
18
+ mistune_plugins = ["footnotes", "superscript", "table"]
19
+ md = mistune.create_markdown(plugins=mistune_plugins, escape=False)
19
20
 
20
21
 
21
22
  def slugify_(value):
@@ -10,6 +10,7 @@ from PIL import Image, UnidentifiedImageError
10
10
  from slugify import slugify
11
11
  from yaml.composer import ComposerError
12
12
 
13
+ from .generator import mistune_plugins
13
14
  from .typography import typographie
14
15
 
15
16
 
@@ -35,7 +36,7 @@ class ImgsWithSizesRenderer(FrenchTypographyRenderer):
35
36
  base_url=None,
36
37
  article=None,
37
38
  ):
38
- super().__init__()
39
+ super().__init__(escape, allow_harmful_protocols)
39
40
  self._base_url = base_url
40
41
  self._article = article
41
42
 
@@ -45,7 +46,7 @@ class ImgsWithSizesRenderer(FrenchTypographyRenderer):
45
46
  return text
46
47
  return super().paragraph(text)
47
48
 
48
- def image(self, alt, url):
49
+ def image(self, text, url, title=None):
49
50
  if self._article.images_path is None:
50
51
  print(f"Image with URL `{url}` is discarded.")
51
52
  return ""
@@ -56,7 +57,7 @@ class ImgsWithSizesRenderer(FrenchTypographyRenderer):
56
57
  print(f"`{full_path}` is not a valid image.")
57
58
  return ""
58
59
  width, height = image.size
59
- caption = f"<figcaption>{alt}</figcaption>" if alt else ""
60
+ caption = f"<figcaption>{text}</figcaption>" if text else ""
60
61
  full_url = f"{self._base_url}{self._article.url}{url}"
61
62
  return dedent(
62
63
  f"""\
@@ -68,7 +69,7 @@ class ImgsWithSizesRenderer(FrenchTypographyRenderer):
68
69
  width="{width}" height="{height}"
69
70
  loading="lazy"
70
71
  decoding="async"
71
- alt="{alt}">
72
+ alt="{text}">
72
73
  </a>
73
74
  {caption}
74
75
  </figure>
@@ -135,7 +136,8 @@ class Numero(YAMLWizard):
135
136
  base_url=base_url,
136
137
  article=loaded_article,
137
138
  ),
138
- plugins=["footnotes", "superscript"],
139
+ plugins=mistune_plugins,
140
+ escape=False,
139
141
  )
140
142
  loaded_article.content_html = md(loaded_article.content_md)
141
143
  loaded_articles.append(loaded_article)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes