Skip to content

Commit

Permalink
release: 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
RyotaUshio committed Nov 21, 2023
1 parent 8f66907 commit ebc8173
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "better-link-autocompletion",
"name": "Better Link Autocompletion",
"version": "0.1.1",
"version": "0.1.2",
"minAppVersion": "1.3.5",
"description": "Enhance Obsidian's built-in link autocompletion.",
"author": "Ryota Ushio",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-better-link-autocompletion",
"version": "0.1.1",
"version": "0.1.2",
"description": "Enhance Obsidian's built-in link autocompletion.",
"scripts": {
"dev": "node esbuild.config.mjs",
Expand Down
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface BlockLinkInfo extends LinkInfo {
type: "block";
idMatch: SearchMatches | null;
subpath: string;
node: any;
node?: any;
display: string;
content: string;
}
Expand Down Expand Up @@ -62,12 +62,13 @@ export default class MyPlugin extends Plugin {
patch() {
// @ts-ignore
const prototype = this.app.workspace.editorSuggest.suggests[0].constructor.prototype as BuiltInAutocompletion;
const plugin = this;

const uninstaller = around(prototype, {
renderSuggestion(old) {
return function (item: Item, el: HTMLElement) {
if (item.type === "block") {
if (this.settings.math && item.node.type === "math") {
if (plugin.settings.math && item.node?.type === "math") {
el.appendChild(renderMath(item.node.value, true))
return;
}
Expand Down

0 comments on commit ebc8173

Please sign in to comment.