Commit 074c5802 authored by github-actions[bot]'s avatar github-actions[bot]

chore: bump gomark

- Bump protoc-gen-go version from v1.36.8 to v1.36.9 in multiple generated files.
- Enhance OpenAPI descriptions for various endpoints to improve clarity and readability.
- Fix typo in the description list handling in the markdown service.
- Update HTMLElement component to handle children and self-closing tags correctly.
- Modify types in the markdown service to include children and self-closing properties for HTML elements.
parent 8d8cc83f
...@@ -23,7 +23,7 @@ require ( ...@@ -23,7 +23,7 @@ require (
github.com/spf13/cobra v1.10.1 github.com/spf13/cobra v1.10.1
github.com/spf13/viper v1.20.1 github.com/spf13/viper v1.20.1
github.com/stretchr/testify v1.10.0 github.com/stretchr/testify v1.10.0
github.com/usememos/gomark v0.0.0-20250917125604-82623ecaf218 github.com/usememos/gomark v0.0.0-20250925160223-606d7debad77
golang.org/x/crypto v0.41.0 golang.org/x/crypto v0.41.0
golang.org/x/mod v0.27.0 golang.org/x/mod v0.27.0
golang.org/x/net v0.43.0 golang.org/x/net v0.43.0
......
...@@ -433,8 +433,8 @@ github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVM ...@@ -433,8 +433,8 @@ github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVM
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/usememos/gomark v0.0.0-20250917125604-82623ecaf218 h1:rkH9CKI0AzWOIkwzZOs0PYepWt9fJTZZ9c5W1lL/bMQ= github.com/usememos/gomark v0.0.0-20250925160223-606d7debad77 h1:eDJ/NUqDIvQbyXwqiKaUC3Y4lvbauSME+KLmpaxRytk=
github.com/usememos/gomark v0.0.0-20250917125604-82623ecaf218/go.mod h1:7CZRoYFQyyljzplOTeyODFR26O+wr0BbnpTWVLGfKJA= github.com/usememos/gomark v0.0.0-20250925160223-606d7debad77/go.mod h1:7CZRoYFQyyljzplOTeyODFR26O+wr0BbnpTWVLGfKJA=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
......
...@@ -326,4 +326,6 @@ message SpoilerNode { ...@@ -326,4 +326,6 @@ message SpoilerNode {
message HTMLElementNode { message HTMLElementNode {
string tag_name = 1; string tag_name = 1;
map<string, string> attributes = 2; map<string, string> attributes = 2;
repeated Node children = 3;
bool is_self_closing = 4;
} }
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: api/v1/activity_service.proto // source: api/v1/activity_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: api/v1/attachment_service.proto // source: api/v1/attachment_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: api/v1/auth_service.proto // source: api/v1/auth_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: api/v1/common.proto // source: api/v1/common.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: api/v1/idp_service.proto // source: api/v1/idp_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: api/v1/inbox_service.proto // source: api/v1/inbox_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: api/v1/markdown_service.proto // source: api/v1/markdown_service.proto
...@@ -2634,6 +2634,8 @@ type HTMLElementNode struct { ...@@ -2634,6 +2634,8 @@ type HTMLElementNode struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
TagName string `protobuf:"bytes,1,opt,name=tag_name,json=tagName,proto3" json:"tag_name,omitempty"` TagName string `protobuf:"bytes,1,opt,name=tag_name,json=tagName,proto3" json:"tag_name,omitempty"`
Attributes map[string]string `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` Attributes map[string]string `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
Children []*Node `protobuf:"bytes,3,rep,name=children,proto3" json:"children,omitempty"`
IsSelfClosing bool `protobuf:"varint,4,opt,name=is_self_closing,json=isSelfClosing,proto3" json:"is_self_closing,omitempty"`
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
...@@ -2682,6 +2684,20 @@ func (x *HTMLElementNode) GetAttributes() map[string]string { ...@@ -2682,6 +2684,20 @@ func (x *HTMLElementNode) GetAttributes() map[string]string {
return nil return nil
} }
func (x *HTMLElementNode) GetChildren() []*Node {
if x != nil {
return x.Children
}
return nil
}
func (x *HTMLElementNode) GetIsSelfClosing() bool {
if x != nil {
return x.IsSelfClosing
}
return false
}
type TableNode_Row struct { type TableNode_Row struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
Cells []*Node `protobuf:"bytes,1,rep,name=cells,proto3" json:"cells,omitempty"` Cells []*Node `protobuf:"bytes,1,rep,name=cells,proto3" json:"cells,omitempty"`
...@@ -2874,12 +2890,14 @@ const file_api_v1_markdown_service_proto_rawDesc = "" + ...@@ -2874,12 +2890,14 @@ const file_api_v1_markdown_service_proto_rawDesc = "" +
"\rresource_name\x18\x01 \x01(\tR\fresourceName\x12\x16\n" + "\rresource_name\x18\x01 \x01(\tR\fresourceName\x12\x16\n" +
"\x06params\x18\x02 \x01(\tR\x06params\"'\n" + "\x06params\x18\x02 \x01(\tR\x06params\"'\n" +
"\vSpoilerNode\x12\x18\n" + "\vSpoilerNode\x12\x18\n" +
"\acontent\x18\x01 \x01(\tR\acontent\"\xba\x01\n" + "\acontent\x18\x01 \x01(\tR\acontent\"\x92\x02\n" +
"\x0fHTMLElementNode\x12\x19\n" + "\x0fHTMLElementNode\x12\x19\n" +
"\btag_name\x18\x01 \x01(\tR\atagName\x12M\n" + "\btag_name\x18\x01 \x01(\tR\atagName\x12M\n" +
"\n" + "\n" +
"attributes\x18\x02 \x03(\v2-.memos.api.v1.HTMLElementNode.AttributesEntryR\n" + "attributes\x18\x02 \x03(\v2-.memos.api.v1.HTMLElementNode.AttributesEntryR\n" +
"attributes\x1a=\n" + "attributes\x12.\n" +
"\bchildren\x18\x03 \x03(\v2\x12.memos.api.v1.NodeR\bchildren\x12&\n" +
"\x0fis_self_closing\x18\x04 \x01(\bR\risSelfClosing\x1a=\n" +
"\x0fAttributesEntry\x12\x10\n" + "\x0fAttributesEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01*\x83\x04\n" + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01*\x83\x04\n" +
...@@ -3039,20 +3057,21 @@ var file_api_v1_markdown_service_proto_depIdxs = []int32{ ...@@ -3039,20 +3057,21 @@ var file_api_v1_markdown_service_proto_depIdxs = []int32{
10, // 46: memos.api.v1.ItalicNode.children:type_name -> memos.api.v1.Node 10, // 46: memos.api.v1.ItalicNode.children:type_name -> memos.api.v1.Node
10, // 47: memos.api.v1.LinkNode.content:type_name -> memos.api.v1.Node 10, // 47: memos.api.v1.LinkNode.content:type_name -> memos.api.v1.Node
43, // 48: memos.api.v1.HTMLElementNode.attributes:type_name -> memos.api.v1.HTMLElementNode.AttributesEntry 43, // 48: memos.api.v1.HTMLElementNode.attributes:type_name -> memos.api.v1.HTMLElementNode.AttributesEntry
10, // 49: memos.api.v1.TableNode.Row.cells:type_name -> memos.api.v1.Node 10, // 49: memos.api.v1.HTMLElementNode.children:type_name -> memos.api.v1.Node
2, // 50: memos.api.v1.MarkdownService.ParseMarkdown:input_type -> memos.api.v1.ParseMarkdownRequest 10, // 50: memos.api.v1.TableNode.Row.cells:type_name -> memos.api.v1.Node
4, // 51: memos.api.v1.MarkdownService.RestoreMarkdownNodes:input_type -> memos.api.v1.RestoreMarkdownNodesRequest 2, // 51: memos.api.v1.MarkdownService.ParseMarkdown:input_type -> memos.api.v1.ParseMarkdownRequest
6, // 52: memos.api.v1.MarkdownService.StringifyMarkdownNodes:input_type -> memos.api.v1.StringifyMarkdownNodesRequest 4, // 52: memos.api.v1.MarkdownService.RestoreMarkdownNodes:input_type -> memos.api.v1.RestoreMarkdownNodesRequest
8, // 53: memos.api.v1.MarkdownService.GetLinkMetadata:input_type -> memos.api.v1.GetLinkMetadataRequest 6, // 53: memos.api.v1.MarkdownService.StringifyMarkdownNodes:input_type -> memos.api.v1.StringifyMarkdownNodesRequest
3, // 54: memos.api.v1.MarkdownService.ParseMarkdown:output_type -> memos.api.v1.ParseMarkdownResponse 8, // 54: memos.api.v1.MarkdownService.GetLinkMetadata:input_type -> memos.api.v1.GetLinkMetadataRequest
5, // 55: memos.api.v1.MarkdownService.RestoreMarkdownNodes:output_type -> memos.api.v1.RestoreMarkdownNodesResponse 3, // 55: memos.api.v1.MarkdownService.ParseMarkdown:output_type -> memos.api.v1.ParseMarkdownResponse
7, // 56: memos.api.v1.MarkdownService.StringifyMarkdownNodes:output_type -> memos.api.v1.StringifyMarkdownNodesResponse 5, // 56: memos.api.v1.MarkdownService.RestoreMarkdownNodes:output_type -> memos.api.v1.RestoreMarkdownNodesResponse
9, // 57: memos.api.v1.MarkdownService.GetLinkMetadata:output_type -> memos.api.v1.LinkMetadata 7, // 57: memos.api.v1.MarkdownService.StringifyMarkdownNodes:output_type -> memos.api.v1.StringifyMarkdownNodesResponse
54, // [54:58] is the sub-list for method output_type 9, // 58: memos.api.v1.MarkdownService.GetLinkMetadata:output_type -> memos.api.v1.LinkMetadata
50, // [50:54] is the sub-list for method input_type 55, // [55:59] is the sub-list for method output_type
50, // [50:50] is the sub-list for extension type_name 51, // [51:55] is the sub-list for method input_type
50, // [50:50] is the sub-list for extension extendee 51, // [51:51] is the sub-list for extension type_name
0, // [0:50] is the sub-list for field type_name 51, // [51:51] is the sub-list for extension extendee
0, // [0:51] is the sub-list for field type_name
} }
func init() { file_api_v1_markdown_service_proto_init() } func init() { file_api_v1_markdown_service_proto_init() }
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: api/v1/memo_service.proto // source: api/v1/memo_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: api/v1/shortcut_service.proto // source: api/v1/shortcut_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: api/v1/user_service.proto // source: api/v1/user_service.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: api/v1/workspace_service.proto // source: api/v1/workspace_service.proto
......
This diff is collapsed.
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: store/activity.proto // source: store/activity.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: store/attachment.proto // source: store/attachment.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: store/idp.proto // source: store/idp.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: store/inbox.proto // source: store/inbox.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: store/memo.proto // source: store/memo.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: store/user_setting.proto // source: store/user_setting.proto
......
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.36.8 // protoc-gen-go v1.36.9
// protoc (unknown) // protoc (unknown)
// source: store/workspace_setting.proto // source: store/workspace_setting.proto
......
...@@ -128,7 +128,12 @@ func convertFromASTNode(rawNode ast.Node) *v1pb.Node { ...@@ -128,7 +128,12 @@ func convertFromASTNode(rawNode ast.Node) *v1pb.Node {
case *ast.Spoiler: case *ast.Spoiler:
node.Node = &v1pb.Node_SpoilerNode{SpoilerNode: &v1pb.SpoilerNode{Content: n.Content}} node.Node = &v1pb.Node_SpoilerNode{SpoilerNode: &v1pb.SpoilerNode{Content: n.Content}}
case *ast.HTMLElement: case *ast.HTMLElement:
node.Node = &v1pb.Node_HtmlElementNode{HtmlElementNode: &v1pb.HTMLElementNode{TagName: n.TagName, Attributes: n.Attributes}} node.Node = &v1pb.Node_HtmlElementNode{HtmlElementNode: &v1pb.HTMLElementNode{
TagName: n.TagName,
Attributes: n.Attributes,
Children: convertFromASTNodes(n.Children),
IsSelfClosing: n.IsSelfClosing,
}}
default: default:
node.Node = &v1pb.Node_TextNode{TextNode: &v1pb.TextNode{}} node.Node = &v1pb.Node_TextNode{TextNode: &v1pb.TextNode{}}
} }
...@@ -168,7 +173,7 @@ func convertListKindFromASTNode(node ast.ListKind) v1pb.ListNode_Kind { ...@@ -168,7 +173,7 @@ func convertListKindFromASTNode(node ast.ListKind) v1pb.ListNode_Kind {
return v1pb.ListNode_ORDERED return v1pb.ListNode_ORDERED
case ast.UnorderedList: case ast.UnorderedList:
return v1pb.ListNode_UNORDERED return v1pb.ListNode_UNORDERED
case ast.DescrpitionList: case ast.DescriptionList:
return v1pb.ListNode_DESCRIPTION return v1pb.ListNode_DESCRIPTION
default: default:
return v1pb.ListNode_KIND_UNSPECIFIED return v1pb.ListNode_KIND_UNSPECIFIED
...@@ -249,7 +254,16 @@ func convertToASTNode(node *v1pb.Node) ast.Node { ...@@ -249,7 +254,16 @@ func convertToASTNode(node *v1pb.Node) ast.Node {
case *v1pb.Node_SpoilerNode: case *v1pb.Node_SpoilerNode:
return &ast.Spoiler{Content: n.SpoilerNode.Content} return &ast.Spoiler{Content: n.SpoilerNode.Content}
case *v1pb.Node_HtmlElementNode: case *v1pb.Node_HtmlElementNode:
return &ast.HTMLElement{TagName: n.HtmlElementNode.TagName, Attributes: n.HtmlElementNode.Attributes} var children []ast.Node
if len(n.HtmlElementNode.Children) > 0 {
children = convertToASTNodes(n.HtmlElementNode.Children)
}
return &ast.HTMLElement{
TagName: n.HtmlElementNode.TagName,
Attributes: n.HtmlElementNode.Attributes,
Children: children,
IsSelfClosing: n.HtmlElementNode.IsSelfClosing,
}
default: default:
return &ast.Text{} return &ast.Text{}
} }
...@@ -286,9 +300,9 @@ func convertListKindToASTNode(kind v1pb.ListNode_Kind) ast.ListKind { ...@@ -286,9 +300,9 @@ func convertListKindToASTNode(kind v1pb.ListNode_Kind) ast.ListKind {
case v1pb.ListNode_UNORDERED: case v1pb.ListNode_UNORDERED:
return ast.UnorderedList return ast.UnorderedList
case v1pb.ListNode_DESCRIPTION: case v1pb.ListNode_DESCRIPTION:
return ast.DescrpitionList return ast.DescriptionList
default: default:
// Default to description list. // Default to description list.
return ast.DescrpitionList return ast.DescriptionList
} }
} }
import { createElement } from "react"; import { createElement } from "react";
import { Node } from "@/types/proto/api/v1/markdown_service";
import Renderer from "./Renderer";
interface Props { interface Props {
tagName: string; tagName: string;
attributes: { [key: string]: string }; attributes: { [key: string]: string };
children: Node[];
isSelfClosing: boolean;
} }
const HTMLElement: React.FC<Props> = ({ tagName, attributes }: Props) => { const HTMLElement: React.FC<Props> = ({ tagName, attributes, children, isSelfClosing }: Props) => {
if (isSelfClosing) {
return createElement(tagName, attributes); return createElement(tagName, attributes);
}
return createElement(
tagName,
attributes,
children.map((child, index) => <Renderer key={`${child.type}-${index}`} index={String(index)} node={child} />),
);
}; };
export default HTMLElement; export default HTMLElement;
...@@ -503,6 +503,8 @@ export interface SpoilerNode { ...@@ -503,6 +503,8 @@ export interface SpoilerNode {
export interface HTMLElementNode { export interface HTMLElementNode {
tagName: string; tagName: string;
attributes: { [key: string]: string }; attributes: { [key: string]: string };
children: Node[];
isSelfClosing: boolean;
} }
export interface HTMLElementNode_AttributesEntry { export interface HTMLElementNode_AttributesEntry {
...@@ -3085,7 +3087,7 @@ export const SpoilerNode: MessageFns<SpoilerNode> = { ...@@ -3085,7 +3087,7 @@ export const SpoilerNode: MessageFns<SpoilerNode> = {
}; };
function createBaseHTMLElementNode(): HTMLElementNode { function createBaseHTMLElementNode(): HTMLElementNode {
return { tagName: "", attributes: {} }; return { tagName: "", attributes: {}, children: [], isSelfClosing: false };
} }
export const HTMLElementNode: MessageFns<HTMLElementNode> = { export const HTMLElementNode: MessageFns<HTMLElementNode> = {
...@@ -3096,6 +3098,12 @@ export const HTMLElementNode: MessageFns<HTMLElementNode> = { ...@@ -3096,6 +3098,12 @@ export const HTMLElementNode: MessageFns<HTMLElementNode> = {
Object.entries(message.attributes).forEach(([key, value]) => { Object.entries(message.attributes).forEach(([key, value]) => {
HTMLElementNode_AttributesEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join(); HTMLElementNode_AttributesEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join();
}); });
for (const v of message.children) {
Node.encode(v!, writer.uint32(26).fork()).join();
}
if (message.isSelfClosing !== false) {
writer.uint32(32).bool(message.isSelfClosing);
}
return writer; return writer;
}, },
...@@ -3125,6 +3133,22 @@ export const HTMLElementNode: MessageFns<HTMLElementNode> = { ...@@ -3125,6 +3133,22 @@ export const HTMLElementNode: MessageFns<HTMLElementNode> = {
} }
continue; continue;
} }
case 3: {
if (tag !== 26) {
break;
}
message.children.push(Node.decode(reader, reader.uint32()));
continue;
}
case 4: {
if (tag !== 32) {
break;
}
message.isSelfClosing = reader.bool();
continue;
}
} }
if ((tag & 7) === 4 || tag === 0) { if ((tag & 7) === 4 || tag === 0) {
break; break;
...@@ -3149,6 +3173,8 @@ export const HTMLElementNode: MessageFns<HTMLElementNode> = { ...@@ -3149,6 +3173,8 @@ export const HTMLElementNode: MessageFns<HTMLElementNode> = {
}, },
{}, {},
); );
message.children = object.children?.map((e) => Node.fromPartial(e)) || [];
message.isSelfClosing = object.isSelfClosing ?? false;
return message; return message;
}, },
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment