R6.7: ElyMark keeps a single line break on screen

Component 93efa7f draws soft breaks as lines (Typora's default when
writing); exports and copies read with MarkdownReader::joined, as GFM.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-15 12:10:41 -04:00
1 parent 0a5d7ea6dd
commit 5958e73ade
6 files changed
+24 -16

No files matched your search

+1 -1
View File
@@ -28,7 +28,7 @@ pub(super) fn write(
placed,
page,
source,
reader: MarkdownReader::new(source, tree),
reader: MarkdownReader::joined(source, tree),
anchored: HashSet::new(),
};
writer.root(tree)
+1 -1
View File
@@ -11,7 +11,7 @@ use markdown::mdast::Node;
pub fn plain(text: &str) -> io::Result<String> {
let tree = markdown::to_mdast(text, &markdown_options())
.map_err(|error| io::Error::other(error.to_string()))?;
let reader = MarkdownReader::new(text, &tree);
let reader = MarkdownReader::joined(text, &tree);
let mut blocks = Vec::new();
// Alerts and `[toc]` live only at the root.
for child in tree.children().into_iter().flatten() {
+7
View File
@@ -230,3 +230,10 @@ fn a_copied_fragment_carries_its_look() {
"the look needs no page style: {page}"
);
}
#[test]
fn a_soft_break_joins_in_exports_as_typora_exports_it() {
let page = html("你好\n测试 \nend\n");
assert!(page.contains("<p>你好 测试<br>end</p>"), "{page}");
assert_eq!(text("你好\n测试\n"), "你好 测试\n");
}