[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/yaml 7c4b2ec9a5 116/124: Merge pull request #49 from zk
From: |
ELPA Syncer |
Subject: |
[elpa] externals/yaml 7c4b2ec9a5 116/124: Merge pull request #49 from zkry/48-encode-remove-leading-newlines |
Date: |
Fri, 29 Nov 2024 16:00:10 -0500 (EST) |
branch: externals/yaml
commit 7c4b2ec9a551c0d2ce0094b030f2ab596f3c32ee
Merge: ee86566af1 7f09102db0
Author: Zachary Romero <zacromero@posteo.net>
Commit: GitHub <noreply@github.com>
Merge pull request #49 from zkry/48-encode-remove-leading-newlines
Remove leading new-lines for yaml-encode
---
yaml-tests.el | 4 ++--
yaml.el | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/yaml-tests.el b/yaml-tests.el
index 9498a337db..b8af0a1c32 100644
--- a/yaml-tests.el
+++ b/yaml-tests.el
@@ -615,10 +615,10 @@ keep: |+
"[1, 2, 3]"))
(should (equal
(yaml-encode `[((foo . bar) (baz . bax))])
- "\n- foo: bar\n baz: bax"))
+ "- foo: bar\n baz: bax"))
(should (equal
(yaml-encode `((deeper . [((foo . bar) (baz . bax))])))
- "\ndeeper: \n- foo: bar\n baz: bax"))
+ "deeper: \n- foo: bar\n baz: bax"))
(should (equal (yaml-parse-string
(yaml-encode [1 [2 [3] 2] 1])
:object-type 'alist
diff --git a/yaml.el b/yaml.el
index 6c61ffcd1a..86e8a21ef9 100644
--- a/yaml.el
+++ b/yaml.el
@@ -2765,6 +2765,9 @@ Rules for this function are defined by the yaml-spec JSON
file."
"Encode OBJECT to a YAML string."
(with-temp-buffer
(yaml--encode-object object 0)
+ (goto-char (point-min))
+ (while (looking-at-p "\n")
+ (delete-char 1))
(buffer-string)))
(defun yaml--encode-object (object indent &optional auto-indent)
- [elpa] externals/yaml c81f87f0fd 080/124: fix unit test, (continued)
- [elpa] externals/yaml c81f87f0fd 080/124: fix unit test, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 7783d802b0 102/124: Don't remove all properties, just yaml-n, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 73fde9d8fb 110/124: Merge pull request #44 from kisaragi-hiu/eldoc-hints, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml e787dd06c6 106/124: Merge pull request #42 from kisaragi-hiu/bring-docstring-up-to-date, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 5af0cd7c55 122/124: Fix octal/hex parsing (#54), ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 4a3243a2be 108/124: yaml--the-end: fix incorrect regexp, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 3381a5d2f7 109/124: Merge pull request #43 from kisaragi-hiu/fix/regexp-missing-escape, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 70c4fcead9 124/124: bump version, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 37a6b80ee3 121/124: Update declared version to match tag, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 604774d385 117/124: Add documentation on running tests, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 7c4b2ec9a5 116/124: Merge pull request #49 from zkry/48-encode-remove-leading-newlines,
ELPA Syncer <=
- [elpa] externals/yaml 708dd886a2 001/124: Initial commit, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 8771e68930 004/124: Got key-value working, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml afdb23754a 024/124: Fix folding string parsing, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 2e2e7d199e 023/124: Implement anchor alias resolution, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 8101f2c1fa 030/124: Add import statement; remove debug messages, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 84b88c9ed1 073/124: Merge pull request #27 from zkry/fix-empty-single-quote-string, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml b6091cc080 077/124: add unit test case, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml cb1cc42bd1 093/124: Merge pull request #36 from zkry/fix-string-values-state-bug, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 39f8412bec 079/124: Fix encoding deeply nested lists, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 25f35c80e4 035/124: Replace string-trim-right with replace-regexp-in-string, ELPA Syncer, 2024/11/29