Daniel 2024-11-10 12:04:56 +08:00
parent 14f5570558
commit a0491cd4ff
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
13 changed files with 21 additions and 18 deletions

View file

@ -107,8 +107,11 @@ func RootChildIDs(rootID string) (ret []string) {
return
}
func NewParagraph() (ret *ast.Node) {
newID := ast.NewNodeID()
func NewParagraph(id string) (ret *ast.Node) {
newID := id
if "" == newID {
newID = ast.NewNodeID()
}
ret = &ast.Node{ID: newID, Type: ast.NodeParagraph}
ret.SetIALAttr("id", newID)
ret.SetIALAttr("updated", newID[:14])