GNU bug report logs - #79817
[PATCH] Fix indentation for CDATA section content

Previous Next

Package: emacs;

Reported by: Huang Jing <rne.kou <at> icloud.com>

Date: Tue, 11 Nov 2025 14:11:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 79817 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#79817; Package emacs. (Tue, 11 Nov 2025 14:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Huang Jing <rne.kou <at> icloud.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 11 Nov 2025 14:11:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Huang Jing <rne.kou <at> icloud.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: [PATCH] Fix indentation for CDATA section content
Date: Tue, 11 Nov 2025 19:21:44 +0800
[Message part 1 (text/plain, inline)]
On Tue, 11 Nov 2025 19:16:13 +0800,
Huang Jing wrote:
> 
> According to https://www.w3.org/TR/REC-xml/#sec-cdata-sect, CDATA
> contains character data, not markup. Therefore I think we should
> preserve original CData indention.
> 
> Example:
> 
>  |      <verbatim lang="c" line="6"><![CDATA[
>  |while (int_tmp > 0) {
>  |  off_read = int_tmp > sizeof (buffer) ? sizeof (buffer) : int_tmp;
>  |  pos_tmp  = read (in_fd, buffer, off_read);
>  |  pos_tmp  = write (out_fd, buffer, off_read);
>  |  int_tmp -= off_read;
>  |}
>  |      ]]></verbatim>
> 
> should be kept as is, not being indented into
> 
>  |      <verbatim lang="c" line="6"><![CDATA[
>  |      while (int_tmp > 0) {
>  |      off_read = int_tmp > sizeof (buffer) ? sizeof (buffer) : int_tmp;
>  |      pos_tmp  = read (in_fd, buffer, off_read);
>  |      pos_tmp  = write (out_fd, buffer, off_read);
>  |      int_tmp -= off_read;
>  |      }
>  |      ]]></verbatim>
> 
> 
> In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.6.0, NS
>  appkit-2575.70 Version 15.7 (Build 24G222)) of 2025-10-14 built on
>  rne.local
> Repository revision: c6475fa2f20e92a32453272a547367232a1e3e83
> Repository branch: feature/igc
> Windowing system distributor 'Apple', version 10.3.2575
> System Description:  macOS 15.7.2
> 
> Configured using:
>  'configure 'CFLAGS=-O3 -march=native -pipe'
>  'CPPFLAGS=-I/tmp/emacs/esrc/../eart '
>  'LDFLAGS=-L/tmp/emacs/esrc/../eart -Wl,-O3' --disable-gc-mark-trace
>  --without-all --with-xml2 --with-native-image-api --with-ns
>  --with-gnutls --with-toolkit-scroll-bars --with-small-ja-dic
>  --with-tree-sitter --with-xwidgets --with-zlib --with-mps'
> 
> <#part type="text/x-patch" filename="~/Public/Projects/emacs-src/0001-Fix-indentation-for-CDATA-section-content.patch" disposition=attachment>
> <#/part>

The patch, correctly appended.

[0001-Fix-indentation-for-CDATA-section-content.patch (text/plain, attachment)]

This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.