Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2022-10-03 17:01:10 +08:00
commit 658193a86f
7 changed files with 13 additions and 3 deletions

View file

@ -1,4 +1,6 @@
{
"defBlock": "Def block",
"defBlockChildren": "Define block and its children",
"filter": "Filter",
"copyHeadings": "Copy Headings and Bottom Blocks",
"tWithSubtitle":"Transformation with subtitles",

View file

@ -1,4 +1,6 @@
{
"defBlock": "Definir bloque",
"defBlockChildren": "Definir bloque y sus hijos",
"filter": "Filtro",
"copyHeadings": "Copiar encabezados y bloques inferiores",
"tWithSubtitle": "Transformación con subtítulos",

View file

@ -1,4 +1,6 @@
{
"defBlock": "Définir le bloc",
"defBlockChildren": "Définir le bloc et ses enfants",
"filter": "Filtre",
"copyHeadings": "Copier les en-têtes et les blocs inférieurs",
"tWithSubtitle": "Transformation avec sous-titres",

View file

@ -1,4 +1,6 @@
{
"defBlock": "定義塊",
"defBlockChildren": "定義塊及其子塊",
"filter": "過濾",
"copyHeadings": "複製標題及下方塊",
"tWithSubtitle": "帶子標題轉換",

View file

@ -1,4 +1,6 @@
{
"defBlock": "定义块",
"defBlockChildren": "定义块及其子块",
"filter": "过滤",
"copyHeadings": "复制标题及下方块",
"tWithSubtitle": "带子标题转换",

View file

@ -220,7 +220,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
});
}
submenu.push({
label: "原始块",
label: window.siyuan.languages.defBlock,
click() {
fetchPost("/api/block/swapBlockRef", {
refID: id,
@ -230,7 +230,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
}
});
submenu.push({
label: "原始块及子块",
label: window.siyuan.languages.defBlockChildren,
click() {
fetchPost("/api/block/swapBlockRef", {
refID: id,

View file

@ -129,12 +129,12 @@ func SwapBlockRef(refID, defID string, includeChildren bool) (err error) {
if ast.NodeListItem == defNode.Type {
if ast.NodeListItem == refNode.Type {
defNode.InsertAfter(refNode)
if !includeChildren {
for _, c := range defNodeChildren {
refNode.AppendChild(c)
}
}
defNode.InsertAfter(refNode)
refPivot.InsertAfter(defNode)
} else {
newID := ast.NewNodeID()