prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Espaces insécables dans le titre de mise en Une
  **Description du bug**
  
  Espace non insécable dans l'aperçu de mis en Une. Ce problème n'a pas pu être par #5292 car l'aperçu est généré par du JavaScript.
  
  **Comment reproduire ?**
  
  La liste des étapes qui permet de reproduire le bug :
  
  1. Se connecter en tant qu'administrateur ;
  2. Accéder à la page d'un contenu ;
  3. Mettre ce contenu en Une ;
  4. Mettre le titre suivant : « `Comment alerter les secours ?` ».
  
  **Comportement attendu**
  
  L'espace doit automatiquement être remplacé par un espace insécable, avant ou après les signes concernés.
  
  </issue>
  <code>
  [start of zds/utils/templatetags/french_typography.py]
  1 from django import template
  2 from django.template.defaultfilters import stringfilter
  3 from django.utils.safestring import mark_safe
  4 
  5 register = template.Library()
  6 
  7 
  8 @register.filter()
  9 @stringfilter
  10 def french_typography(str):
  11     """
  12     Replaces spaces with non-breaking-spaces or narrow non-breaking-spaces
  13     before or after some symbols, according to French typography.
  14 
  15     This filter is naive and should not be used on Markdown content.
  16     """
  17     return mark_safe(
  18         # Narrow non-breaking space: &#8239;
  19         str.replace(' ;', '&#8239;;')
  20            .replace(' ?', '&#8239;?')
  21            .replace(' !', '&#8239;!')
  22            .replace(' %', '&#8239;%')
  23         # Non-breaking space: &nbsp;
  24            .replace('« ', '«&nbsp;')
  25            .replace(' »', '&nbsp;»')
  26            .replace(' :', '&nbsp;:')
  27     )
  28
  [end of zds/utils/templatetags/french_typography.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/zds/utils/templatetags/french_typography.py b/zds/utils/templatetags/french_typography.py
  --- a/zds/utils/templatetags/french_typography.py
  +++ b/zds/utils/templatetags/french_typography.py
  @@ -13,6 +13,9 @@
       before or after some symbols, according to French typography.
   
       This filter is naive and should not be used on Markdown content.
  +
  +
  +    Any change here should also be made in assets/js/featured-resource-preview.js
       """
       return mark_safe(
           # Narrow non-breaking space: &#8239;
  
verification_info: {"golden_diff": "diff --git a/zds/utils/templatetags/french_typography.py b/zds/utils/templatetags/french_typography.py\n--- a/zds/utils/templatetags/french_typography.py\n+++ b/zds/utils/templatetags/french_typography.py\n@@ -13,6 +13,9 @@\n     before or after some symbols, according to French typography.\n \n     This filter is naive and should not be used on Markdown content.\n+\n+\n+    Any change here should also be made in assets/js/featured-resource-preview.js\n     \"\"\"\n     return mark_safe(\n         # Narrow non-breaking space: &#8239;\n", "issue": "Espaces ins\u00e9cables dans le titre de mise en Une\n**Description du bug**\r\n\r\nEspace non ins\u00e9cable dans l'aper\u00e7u de mis en Une. Ce probl\u00e8me n'a pas pu \u00eatre par #5292 car l'aper\u00e7u est g\u00e9n\u00e9r\u00e9 par du JavaScript.\r\n\r\n**Comment reproduire ?**\r\n\r\nLa liste des \u00e9tapes qui permet de reproduire le bug :\r\n\r\n1. Se connecter en tant qu'administrateur\u00a0;\r\n2. Acc\u00e9der \u00e0 la page d'un contenu\u00a0;\r\n3. Mettre ce contenu en Une\u00a0;\r\n4. Mettre le titre suivant\u00a0: \u00ab\u00a0`Comment alerter les secours ?` \u00bb.\r\n\r\n**Comportement attendu**\r\n\r\nL'espace doit automatiquement \u00eatre remplac\u00e9 par un espace ins\u00e9cable, avant ou apr\u00e8s les signes concern\u00e9s.\n", "before_files": [{"content": "from django import template\nfrom django.template.defaultfilters import stringfilter\nfrom django.utils.safestring import mark_safe\n\nregister = template.Library()\n\n\n@register.filter()\n@stringfilter\ndef french_typography(str):\n    \"\"\"\n    Replaces spaces with non-breaking-spaces or narrow non-breaking-spaces\n    before or after some symbols, according to French typography.\n\n    This filter is naive and should not be used on Markdown content.\n    \"\"\"\n    return mark_safe(\n        # Narrow non-breaking space: &#8239;\n        str.replace(' ;', '&#8239;;')\n           .replace(' ?', '&#8239;?')\n           .replace(' !', '&#8239;!')\n           .replace(' %', '&#8239;%')\n        # Non-breaking space: &nbsp;\n           .replace('\u00ab ', '\u00ab&nbsp;')\n           .replace(' \u00bb', '&nbsp;\u00bb')\n           .replace(' :', '&nbsp;:')\n    )\n", "path": "zds/utils/templatetags/french_typography.py"}]}