Change in the behaviour of the "preformatted text" formatter?

Previously I could use three backticks before and after a body of text to mark it as preformatted. It would retain the line breaks. This is how stuff works in general markdown, which I thought worked here on discourse. Or, I could select the text and click the “preformatted text” button and that would do the same—line breaks would be retained.Now, line breaks seem to be removed so a multi-line preformatted text become one very long line.

If I write three backticks and then paste multi-line text, it seems to be fine. But if I select multiline text and click the preformatted text button, the line breaks seem to be removed.

Any one else seeing this?

I was trying to preformat the text in this post for example.

I’ve had issues with pre-formatted text a few times in recent weeks, but they seem to have gone away.

The change you are likely seeing is there is a WYSIWYG editing now.
The first icon (M-down arrow) in the edit windows toggles this on and off.

Seems to be off by default for me, maybe it remembers that I toggled it off?

2 Likes

It should remember, yeah. There is a global setting for the default — we could have it either be Markdown or “Rich text”. If we change that, it won’t affect existing users by default.

My vote, for the global default setting, would be for Markdown.

2 Likes

For people who don’t know what Markdown is, the WYSIWYG editor is probably the better choice. And for the users that prefer Markdown (myself included) the setting is remembered.

Agreed we should make it easier for the new contributes.

Is the rich text interface easier? It looks like it has the same UI buttons on the top bar, but it just doesn’t accept the Markdown syntax in the editing window. For the WYSIWYG, the Markdown editor does have that, it is just shown in the preview window to the side. I only see losses, no gains with the rich text editor.

I’m not a UX engineer, but I assume that WYSIWYG should be easier for new users.
We are all not new users.

But the Markdown does have a “what you get” preview, so I don’t see the improvement with the rich text editor. I’m not a new user, but I don’t want to shove a limited interface on this class of “new users” under the assumption that they cannot comprehend that the “WYG” is displayed in the window to the side as they type.


Edit: OK, I guess it is true that clever people will (eventually) discover the toggle switch to enable Markdown, so I’ll give on that point. I wonder though which way is really annoying the greater number of people.

The “Rich Text” mode is IMO closer to what people may know from e-mail clients, word processors, or something like Teams or Slack. And those who find this mode lacking and/or know and prefer Markdown can switch with a single click, permanently.

1 Like

I tried the mobile version. No chance to use it anymore. It was already before quite difficult to work with … now it just fills the screen with a white square that I cant type anything.

Edit: The white square is caused by uBlock Origin. When I switch this off I can edit again.

However the preformatted text as is will make us trouble. I can imagine that code past in “rich text” which looks strange cant be changed to something we are used of.

Lets test it with an inxi.

Paste in html editor:

 inxi -Fzxx
System:
  Kernel: 6.16.5-200.fc42.x86_64 arch: x86_64 bits: 64 compiler: gcc v: 15.2.1
  Desktop: GNOME v: 48.4 tk: GTK v: 3.24.49 wm: gnome-shell dm: 1: GDM
    2: LightDM note: stopped Distro: Fedora Linux 42 (Workstation Edition)
Machine:
  Type: Laptop System: CompuLab product: Intense-PC v: 1.x
    serial: <superuser required>
  Mobo: CompuLab model: Intense-PC v: 1.x serial: <superuser required>
    UEFI: Phoenix v: IPC_2.2.400.5 X64 date: 03/15/2018
Battery:
  Device-1: hidpp_battery_0 model: Logitech M585/M590 Multi-Device Mouse
    serial: <filter> charge: 100% (should be ignored) status: discharging
  Device-2: hidpp_battery_1 model: Logitech Wireless Keyboard K230
    serial: <filter> charge: 55% (should be ignored) status: discharging
CPU:
  Info: dual core model: Intel Core i7-3517UE bits: 64 type: MT MCP
    arch: Ivy Bridge rev: 9 cache: L1: 128 KiB L2: 512 KiB L3: 4 MiB
  Speed (MHz): avg: 798 min/max: 800/2800 cores: 1: 798 2: 798 3: 798 4: 798
    bogomips: 17559
  Flags: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel 3rd Gen Core processor Graphics driver: i915 v: kernel
    arch: Gen-7 ports: active: HDMI-A-1 empty: DP-1, DP-2, HDMI-A-2, VGA-1
    bus-ID: 00:02.0 chip-ID: 8086:0166
  Device-2: Sunplus Innovation FHD Camera Microphone
    driver: snd-usb-audio,uvcvideo type: USB rev: 2.0 speed: 480 Mb/s lanes: 1
    bus-ID: 4-1.6:4 chip-ID: 1bcf:28c4
  Display: wayland server: X.org v: 1.21.1.18 with: Xwayland v: 24.1.8
    compositor: gnome-shell driver: X: loaded: modesetting alternate: fbdev,vesa
    dri: crocus gpu: i915 display-ID: 0
  Monitor-1: HDMI-A-1 model: LG (GoldStar) ULTRAWIDE res: 2560x1080 dpi: 97
    diag: 730mm (28.8")
  API: OpenGL v: 4.2 vendor: intel mesa v: 25.1.7 glx-v: 1.4 es-v: 3.0
    direct-render: yes renderer: Mesa Intel HD Graphics 4000 (IVB GT2)
    device-ID: 8086:0166 display-ID: :0.0
  API: Vulkan v: 1.4.313 surfaces: N/A device: 0 type: integrated-gpu
    driver: mesa intel device-ID: 8086:0166 device: 1 type: cpu
    driver: mesa llvmpipe device-ID: 10005:0000
  API: EGL Message: EGL data requires eglinfo. Check --recommends.
  Info: Tools: api: glxinfo,vulkaninfo x11: xdriinfo, xdpyinfo, xprop,
    xrandr
Audio:
  Device-1: Intel 7 Series/C216 Family High Definition Audio
    driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:1e20
  Device-2: Sunplus Innovation FHD Camera Microphone
    driver: snd-usb-audio,uvcvideo type: USB rev: 2.0 speed: 480 Mb/s lanes: 1
    bus-ID: 4-1.6:4 chip-ID: 1bcf:28c4
  API: ALSA v: k6.16.5-200.fc42.x86_64 status: kernel-api
  Server-1: PipeWire v: 1.4.7 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin
Network:
  Device-1: Intel 82579LM Gigabit Network driver: e1000e v: kernel port: 4080
    bus-ID: 00:19.0 chip-ID: 8086:1502
  IF: enp0s25 state: up speed: 1000 Mbps duplex: full mac: <filter>
  Device-2: Realtek RTL8188CE 802.11b/g/n WiFi Adapter vendor: AzureWave
    driver: rtl8192ce v: kernel pcie: speed: 2.5 GT/s lanes: 1 port: 3000
    bus-ID: 04:00.0 chip-ID: 10ec:8176
  IF: wlp4s0 state: down mac: <filter>
  Device-3: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1 port: 2000
    bus-ID: 06:00.0 chip-ID: 10ec:8168
  IF: enp6s0 state: down mac: <filter>
  IF-ID-1: BR-F41-BR-49 state: unknown speed: N/A duplex: N/A mac: N/A
Bluetooth:
  Device-1: IMC Networks driver: btusb v: 0.8 type: USB rev: 2.0
    speed: 12 Mb/s lanes: 1 bus-ID: 4-1.3:3 chip-ID: 13d3:3331
  Report: btmgmt ID: hci0 rfk-id: 2 state: down bt-service: enabled,running
    rfk-block: hardware: no software: yes address: <filter> bt-v: 2.1 lmp-v: 4
Drives:
  Local Storage: total: 232.89 GiB used: 139.94 GiB (60.1%)
  ID-1: /dev/sda vendor: Samsung model: SSD 840 EVO 250GB size: 232.89 GiB
    speed: 6.0 Gb/s serial: <filter>
Partition:
  ID-1: / size: 230.32 GiB used: 139.45 GiB (60.5%) fs: btrfs dev: /dev/sda3
  ID-2: /boot size: 1.91 GiB used: 478 MiB (24.4%) fs: ext4 dev: /dev/sda2
  ID-3: /boot/efi size: 598.8 MiB used: 19.3 MiB (3.2%) fs: vfat
    dev: /dev/sda1
  ID-4: /home size: 230.32 GiB used: 139.45 GiB (60.5%) fs: btrfs
    dev: /dev/sda3
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 54.0 C mobo: N/A
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 16 GiB note: est. available: 15.04 GiB used: 2.73 GiB (18.2%)
  Processes: 292 Power: uptime: 8h 59m wakeups: 1 Init: systemd v: 257
    target: graphical (5) default: graphical
  Packages: pm: rpm pkgs: N/A note: see --rpm pm: flatpak pkgs: 24
    Compilers: gcc: 15.2.1 Shell: Bash v: 5.2.37 running-in: ptyxis-agent
    inxi: 3.3.38

Paste in Rich Text editor:

inxi -Fzxx
System:
Kernel: 6.16.5-200.fc42.x86_64 arch: x86_64 bits: 64 compiler: gcc v: 15.2.1
Desktop: GNOME v: 48.4 tk: GTK v: 3.24.49 wm: gnome-shell dm: 1: GDM
2: LightDM note: stopped Distro: Fedora Linux 42 (Workstation Edition)
Machine:
Type: Laptop System: CompuLab product: Intense-PC v: 1.x
serial:
Mobo: CompuLab model: Intense-PC v: 1.x serial:
UEFI: Phoenix v: IPC_2.2.400.5 X64 date: 03/15/2018
Battery:
Device-1: hidpp_battery_0 model: Logitech M585/M590 Multi-Device Mouse
serial: charge: 100% (should be ignored) status: discharging
Device-2: hidpp_battery_1 model: Logitech Wireless Keyboard K230
serial: charge: 55% (should be ignored) status: discharging
CPU:
Info: dual core model: Intel Core i7-3517UE bits: 64 type: MT MCP
arch: Ivy Bridge rev: 9 cache: L1: 128 KiB L2: 512 KiB L3: 4 MiB
Speed (MHz): avg: 798 min/max: 800/2800 cores: 1: 798 2: 798 3: 798 4: 798
bogomips: 17559
Flags: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
Device-1: Intel 3rd Gen Core processor Graphics driver: i915 v: kernel
arch: Gen-7 ports: active: HDMI-A-1 empty: DP-1, DP-2, HDMI-A-2, VGA-1
bus-ID: 00:02.0 chip-ID: 8086:0166
Device-2: Sunplus Innovation FHD Camera Microphone
driver: snd-usb-audio,uvcvideo type: USB rev: 2.0 speed: 480 Mb/s lanes: 1
bus-ID: 4-1.6:4 chip-ID: 1bcf:28c4
Display: wayland server: ``X.org`` v: 1.21.1.18 with: Xwayland v: 24.1.8
compositor: gnome-shell driver: X: loaded: modesetting alternate: fbdev,vesa
dri: crocus gpu: i915 display-ID: 0
Monitor-1: HDMI-A-1 model: LG (GoldStar) ULTRAWIDE res: 2560x1080 dpi: 97
diag: 730mm (28.8")
API: OpenGL v: 4.2 vendor: intel mesa v: 25.1.7 glx-v: 1.4 es-v: 3.0
direct-render: yes renderer: Mesa Intel HD Graphics 4000 (IVB GT2)
device-ID: 8086:0166 display-ID: :0.0
API: Vulkan v: 1.4.313 surfaces: N/A device: 0 type: integrated-gpu
driver: mesa intel device-ID: 8086:0166 device: 1 type: cpu
driver: mesa llvmpipe device-ID: 10005:0000
API: EGL Message: EGL data requires eglinfo. Check --recommends.
Info: Tools: api: glxinfo,vulkaninfo x11: xdriinfo, xdpyinfo, xprop,
xrandr
Audio:
Device-1: Intel 7 Series/C216 Family High Definition Audio
driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:1e20
Device-2: Sunplus Innovation FHD Camera Microphone
driver: snd-usb-audio,uvcvideo type: USB rev: 2.0 speed: 480 Mb/s lanes: 1
bus-ID: 4-1.6:4 chip-ID: 1bcf:28c4
API: ALSA v: k6.16.5-200.fc42.x86_64 status: kernel-api
Server-1: PipeWire v: 1.4.7 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin
Network:
Device-1: Intel 82579LM Gigabit Network driver: e1000e v: kernel port: 4080
bus-ID: 00:19.0 chip-ID: 8086:1502
IF: enp0s25 state: up speed: 1000 Mbps duplex: full mac:
Device-2: Realtek RTL8188CE 802.11b/g/n WiFi Adapter vendor: AzureWave
driver: rtl8192ce v: kernel pcie: speed: 2.5 GT/s lanes: 1 port: 3000
bus-ID: 04:00.0 chip-ID: 10ec:8176
IF: wlp4s0 state: down mac:
Device-3: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
driver: r8169 v: kernel pcie: speed: 2.5 GT/s lanes: 1 port: 2000
bus-ID: 06:00.0 chip-ID: 10ec:8168
IF: enp6s0 state: down mac:
IF-ID-1: BR-F41-BR-49 state: unknown speed: N/A duplex: N/A mac: N/A
Bluetooth:
Device-1: IMC Networks driver: btusb v: 0.8 type: USB rev: 2.0
speed: 12 Mb/s lanes: 1 bus-ID: 4-1.3:3 chip-ID: 13d3:3331
Report: btmgmt ID: hci0 rfk-id: 2 state: down bt-service: enabled,running
rfk-block: hardware: no software: yes address: bt-v: 2.1 lmp-v: 4
Drives:
Local Storage: total: 232.89 GiB used: 139.94 GiB (60.1%)
ID-1: /dev/sda vendor: Samsung model: SSD 840 EVO 250GB size: 232.89 GiB
speed: 6.0 Gb/s serial:
Partition:
ID-1: / size: 230.32 GiB used: 139.45 GiB (60.5%) fs: btrfs dev: /dev/sda3
ID-2: /boot size: 1.91 GiB used: 478 MiB (24.4%) fs: ext4 dev: /dev/sda2
ID-3: /boot/efi size: 598.8 MiB used: 19.3 MiB (3.2%) fs: vfat
dev: /dev/sda1
ID-4: /home size: 230.32 GiB used: 139.45 GiB (60.5%) fs: btrfs
dev: /dev/sda3
Swap:
ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 54.0 C mobo: N/A
Fan Speeds (rpm): N/A
Info:
Memory: total: 16 GiB note: est. available: 15.04 GiB used: 2.73 GiB (18.2%)
Processes: 292 Power: uptime: 8h 59m wakeups: 1 Init: systemd v: 257
target: graphical (5) default: graphical
Packages: pm: rpm pkgs: N/A note: see --rpm pm: flatpak pkgs: 24
Compilers: gcc: 15.2.1 Shell: Bash v: 5.2.37 running-in: ptyxis-agent
inxi: 3.3.38

1 Like

So it’s the rich text editor that is making that mess! I was wondering how people were doing that.

I found something out, if you click in the Rich Text Editor on Preformatted Text (PFT), you will get a black block which lets you past the code as in the Html editor.

If you past and mark the block and then click on PFT you get single line code blocks as if you just mark on the same line and then it has different color.

It probably would be a good idea to make an announcement how to proceed to get the same outcome as we had.
Problem are the new users, which not are new to PFT and do not know how it should look like.

@mattdm did we not change the basic theme for html editor so, that when you marked more than one line it will create the black block with the scrollbars when clicking on the PFT button.

You can toggle back and forth between the Markdown and Rich Text editor to see what is happening:

  1. In the Rich Text editor, click “Preformatted Text” without a selection. You get a grey block and can paste text. When you switch to Markdown, you see that it inserted a code block, delimited by three backticks (```) at the start and end. (Sidenote, because backticks are dead keys on my keymap, I have trained myself to use ~~~ instead, maybe someone finds this tip useful.)
  2. In the Rich Text editor, select a single word or several words on a single line and click “Preformatted Text”. The words are now surrounded by a grey block inline. And in the Markdown editor, you can see that it got converted to an inline code block, with a single ` at the beginning and end.
  3. In the Rich Text editor, select text that spans multiple lines and click “Preformatted Text”. Now each line is surrounded with a grey block, notice the horizontal breaks between blocks and the ragged right edge (for LTR languages). In the Markdown editor, it is converted to a sequence of lines, each with an individual inline code block. In other words, you get
    `line 1`
    `line 2 with some more words`
    `line 3`
    
    instead of
    ```
    line 1
    line 2 with some more words
    line 3
    ```
    
1 Like

Yeh, this is the bit that was confusing me. It should just end up as a single block of multi-line text instead of either a single line or this weird every line as a code element thing.

1 Like

I would go as far as to suggest this is buggy UX.

2 Likes

It is a bug … on Windows but looks like also affects Linux.

3 Likes