feat(ui): JSON에 nextSep/childSep/nameNewline 포함 및 복원
toJSON() serNode에 nextSep, childSep, nameNewline 필드 추가. parseJsonSection에서 해당 필드 읽어 노드에 복원. JSON slim/full 양쪽 모두 포함됨 (값이 null이 아니므로 stripNulls 통과). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -852,7 +852,10 @@ function toJSON(slim=false){
|
|||||||
footer:node.settings.footer??null,
|
footer:node.settings.footer??null,
|
||||||
prefix:node.settings.prefix??null,
|
prefix:node.settings.prefix??null,
|
||||||
suffix:node.settings.suffix??null,
|
suffix:node.settings.suffix??null,
|
||||||
attributes:attrs,children
|
attributes:attrs,children,
|
||||||
|
nextSep:node.nextSep??'blank',
|
||||||
|
childSep:node.childSep??'blank',
|
||||||
|
nameNewline:node.nameNewline??true,
|
||||||
});
|
});
|
||||||
depth--;
|
depth--;
|
||||||
return r;
|
return r;
|
||||||
@@ -957,6 +960,10 @@ function parseJsonSection(sec){
|
|||||||
const mark=sec.attributes?.mark??'';
|
const mark=sec.attributes?.mark??'';
|
||||||
const n=mkNode(mark, sec.content??'');
|
const n=mkNode(mark, sec.content??'');
|
||||||
|
|
||||||
|
if(sec.nextSep!==undefined) n.nextSep=sec.nextSep;
|
||||||
|
if(sec.childSep!==undefined) n.childSep=sec.childSep;
|
||||||
|
if(sec.nameNewline!==undefined) n.nameNewline=sec.nameNewline;
|
||||||
|
|
||||||
if(sec.header) n.settings.header=sec.header;
|
if(sec.header) n.settings.header=sec.header;
|
||||||
if(sec.footer) n.settings.footer=sec.footer;
|
if(sec.footer) n.settings.footer=sec.footer;
|
||||||
if(sec.prefix) n.settings.prefix=sec.prefix;
|
if(sec.prefix) n.settings.prefix=sec.prefix;
|
||||||
|
|||||||
Reference in New Issue
Block a user