Skip to content

Commit

Permalink
Merge remote-tracking branch 'fork-siyuan/dev' into huge_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Soltus committed Mar 19, 2024
2 parents c8e1fa7 + cf6ac5a commit afa2799
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/appx/AppxManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Identity Name="89C2A984.SiYuan"
ProcessorArchitecture="x64"
Publisher="CN=087C656E-C1D9-42D8-8807-CED45A74FC0F"
Version="3.0.3.0"/>
Version="3.0.4.0"/>
<Properties>
<DisplayName>SiYuan</DisplayName>
<PublisherDisplayName>云南链滴科技有限公司</PublisherDisplayName>
Expand Down
2 changes: 1 addition & 1 deletion app/src/card/openCard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ export const bindCardEvent = async (options: {
deckID: Constants.QUICK_DECK_ID,
blockIDs: [currentCard.blockID],
}, () => {
const minLang = window.siyuan.languages._time["1m"].replace("%s", "")
const minLang = window.siyuan.languages._time["1m"].replace("%s", "");
currentCard.lapses = 0;
currentCard.lastReview = -62135596800000;
currentCard.reps = 0;
Expand Down
2 changes: 1 addition & 1 deletion app/src/history/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
iconElement.classList.add("b3-list-item__arrow--open");
let html = "";
response.data.items.forEach((docItem: { title: string, path: string, op: string }) => {
let chipClass = " b3-chip b3-chip--list "
let chipClass = " b3-chip b3-chip--list ";
if (docItem.op === "clean") {
chipClass += "b3-chip--primary ";
} else if (docItem.op === "update") {
Expand Down
10 changes: 6 additions & 4 deletions app/src/protyle/toolbar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import {Divider} from "./Divider";
import {Font, hasSameTextStyle, setFontStyle} from "./Font";
import {ToolbarItem} from "./ToolbarItem";
import {
fixTableRange, focusBlock,
fixTableRange,
focusBlock,
focusByRange,
focusByWbr,
getEditorRange,
getSelectionPosition, selectAll,
getSelectionPosition,
selectAll,
setFirstNodeRange,
setLastNodeRange
} from "../util/selection";
Expand Down Expand Up @@ -1142,8 +1144,8 @@ export class Toolbar {
const editElement = getContenteditableElement(nodeElement);
if (Constants.SIYUAN_RENDER_CODE_LANGUAGES.includes(languageElement.textContent)) {
nodeElement.dataset.content = editElement.textContent.trim();
nodeElement.dataset.subtype = languageElement.textContent
nodeElement.className = "render-node"
nodeElement.dataset.subtype = languageElement.textContent;
nodeElement.className = "render-node";
nodeElement.innerHTML = `<div spin="1"></div><div class="protyle-attr" contenteditable="false">${Constants.ZWSP}</div>`;
processRender(nodeElement);
} else {
Expand Down
8 changes: 4 additions & 4 deletions app/src/protyle/wysiwyg/enter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {genEmptyElement, insertEmptyBlock} from "../../block/util";
import {getSelectionOffset, focusByWbr, setLastNodeRange, focusBlock, focusByRange} from "../util/selection";
import {focusBlock, focusByRange, focusByWbr, getSelectionOffset, setLastNodeRange} from "../util/selection";
import {
getContenteditableElement,
getTopEmptyElement,
Expand Down Expand Up @@ -84,9 +84,9 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle
setStorageVal(Constants.LOCAL_CODELANG, window.siyuan.storage[Constants.LOCAL_CODELANG]);
}
if (Constants.SIYUAN_RENDER_CODE_LANGUAGES.includes(languageElement.textContent)) {
blockElement.dataset.content = ""
blockElement.dataset.subtype = languageElement.textContent
blockElement.className = "render-node"
blockElement.dataset.content = "";
blockElement.dataset.subtype = languageElement.textContent;
blockElement.className = "render-node";
blockElement.innerHTML = `<div spin="1"></div><div class="protyle-attr" contenteditable="false">${Constants.ZWSP}</div>`;
protyle.toolbar.showRender(protyle, blockElement);
processRender(blockElement);
Expand Down
24 changes: 22 additions & 2 deletions kernel/model/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -885,8 +885,8 @@ func prepareExportTree(bt *treenode.BlockTree) (ret *parse.Tree) {
oldRoot := ret.Root
ret = parse.Parse("", []byte(""), luteEngine.ParseOptions)
first := ret.Root.FirstChild
for _, node := range nodes {
first.InsertBefore(node)
for _, n := range nodes {
first.InsertBefore(n)
}
ret.Root.KramdownIAL = oldRoot.KramdownIAL
}
Expand Down Expand Up @@ -2107,7 +2107,27 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool,
}

if 4 == blockRefMode { // 块引转脚注
unlinks = nil
if footnotesDefBlock := resolveFootnotesDefs(&refFootnotes, ret.Root.ID, blockRefTextLeft, blockRefTextRight); nil != footnotesDefBlock {
// 如果是聚焦导出,可能存在没有使用的脚注定义块,在这里进行清理
// Improve focus export conversion of block refs to footnotes https://github.com/siyuan-note/siyuan/issues/10647
footnotesRefs := ret.Root.ChildrenByType(ast.NodeFootnotesRef)
for footnotesDef := footnotesDefBlock.FirstChild; nil != footnotesDef; footnotesDef = footnotesDef.Next {
exist := false
for _, ref := range footnotesRefs {
if ref.FootnotesRefId == footnotesDef.FootnotesRefId {
exist = true
break
}
}
if !exist {
unlinks = append(unlinks, footnotesDef)
}
}
for _, n := range unlinks {
n.Unlink()
}

ret.Root.AppendChild(footnotesDefBlock)
}
}
Expand Down

0 comments on commit afa2799

Please sign in to comment.