3

Il arrive parfois que des nouveaux utilisateurs emploient l'élément ou (preformated text) pour des mots-clés dans le texte ou pour des citations plutôt que les italiques, le gras ou le . De plus, il y a la question du retour à la ligne :


Je veux changer de ligne dès maintenant ! je viens d'appuyer sur sur mon clavier et dans l'outil je suis sur une deuxième ligne mais pas dans ce qui est affiché...

Je veux changer de ligne dès maintenant !
je viens de taper deux espaces consécutifs et dans l'outil autant qu'à l'affichage, je suis sur une deuxième ligne.


Avec le ou « bloc de citation » il y a un défi supplémentaire, c'est que les deux espaces ne fonctionnement pas :

Je veux changer de ligne dès maintenant ! je viens de taper deux espaces consécutifs et dans l'outil autant qu'à l'affichage, je suis toujours sur la même ligne ligne.

J'ai donc recours à <br> (ce pourrait être n'importe quoi entre < et > mais je choisis « br » pour break et c'est conforme à un ancien tag html). J'ajoute ce <br> à l'endroit où je veux changer de ligne, puis je sélectionne les deux lignes et je clique sur l'icône « blockquote » :

Dans l'éditeur je vois ceci :

> Je veux changer de ligne dès maintenant !<br> [ceci est le br qui
> cause le changement] et en ajoutant ce `<br>` [ceci est un br que
> j'écris et qui ne cause aucun changement comme j'emploie preformatted]
> je suis sur une autre ligne.

À l'affichage on voit ceci :

Je veux changer de ligne dès maintenant !
[ceci est le br qui cause le changement ; il est invisible mais a causé le retour] et en ajoutant ce <br> [ceci est un br que j'écris et qui ne cause aucun changement comme j'emploie preformatted] je suis sur une autre ligne.


  • L'emploi de ce <br> dans un bloc de citation est-il une pratique exemplaire ou autrement quelle pratique l'est ?
  • Dans un contexte d'extraction/reproduction du contenu à l'aide d'un outil de type « file/text tool » (Unix/Linux etc.), cette pratique pose-t-elle problème ?
5
  • "Quelle pratique l'est-elle ?" est un solécisme, la syntaxe correcte est : "Quelle pratique l'est ?" Jan 7, 2023 at 21:11
  • You don't need HTML code to create a new line inside a blockquote; the two spaces (followed by a return / line break) at the end of the line work perfectly well.
    – Tsundoku Mod
    Jan 7, 2023 at 21:17
  • I have just edited your first example, adding actual quote markup, and it works.
    – Tsundoku Mod
    Jan 7, 2023 at 21:58
  • That's because you haven't repeated to > at the start of the last line.
    – Tsundoku Mod
    Jan 7, 2023 at 22:14
  • @Tsundoku I understand, the thing is I don't add this char manually, I select the block and click the blockquote icon... Jan 7, 2023 at 22:19

2 Answers 2

4

A line break inside a blockquote is created by two spaces at the end of a line, followed by a line break. You can choose whether you repeat the > or not.

Example with only one > at the start of the first line:

To be, or not to be, that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take Arms against a Sea of troubles,
And by opposing end them: to die, to sleep
No more; and by a sleep, to say we end
(…)

Example with an > at the start each line:

To be, or not to be, that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take Arms against a Sea of troubles,
And by opposing end them: to die, to sleep
No more; and by a sleep, to say we end
(…)

The output looks exactly the same.

2
  • I'm happy we're clear with this, it's been years, my technique was basically reproducing something I had seen on ELU. Thanks again! Jan 7, 2023 at 22:41
  • 1
    Nice! I was using <br> myself...
    – Luke Sawczak Mod
    Jan 8, 2023 at 2:08
0

You don't need HTML code to create a new line inside a blockquote; the two spaces (followed by a return / line break) at the end of the line work perfectly well.

Testing this here:

You don't need HTML code to create a new line inside a blockquote; the two spaces (followed by a return / line break) [trying this right after these brackets] at the end of the line work perfectly well.

You don't need HTML code to create a new line inside a blockquote; the two spaces (followed by a return / line break) [trying this right after these brackets]
at the end of the line work perfectly well.

Please see markup. This works by breaking the markup AFAIK (see second instance) ie. the last line no longer begins with > (blockquote code).

You don't need HTML code to create a new line inside a blockquote; the two spaces (followed by a return / line break) [trying this right after these brackets]
at the end of the line work perfectly well. Then I'm adding further stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff.

> You don't need HTML code to create a new line inside a blockquote; the
> two spaces (followed by a return / line break) [trying this right after
> these brackets]   
at the end of the line work perfectly well. Then I'm adding further stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff.

The output is still visually in the blockquote but the markup is incoherent imho. So ok it technically works but I don't find it markup-sane.

Let's say I want to reproduce the output of the quote from Tsundoku's answer. I select the ouput and paste it in the tool. Then in the tool I add two spaces and press enter at the end of each line and backspace to undo the extra line for each line, then select the entire block then click the blockquote icon (enter image description here) and I get this:

To be, or not to be, that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take Arms against a Sea of troubles, And by opposing end them: to die, to sleep No more; and by a sleep, to say we end (…)

> To be, or not to be, that is the question:   Whether 'tis nobler in
> the mind to suffer   The slings and arrows of outrageous fortune,   Or
> to take Arms against a Sea of troubles,   And by opposing end them: to
> die, to sleep   No more; and by a sleep, to say we end   (…)

What I need to do is not use the icon and add the > manually:

To be, or not to be, that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take Arms against a Sea of troubles,
And by opposing end them: to die, to sleep
No more; and by a sleep, to say we end
(…)

This is not how I use the editor, it makes the blockquote icon usage moot but granted it works like so and has the benefit of not having extra useless markup.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .