diff --git a/.github/workflows/edge.yml b/.github/workflows/edge.yml index 7e9d427e..5b15c2a6 100644 --- a/.github/workflows/edge.yml +++ b/.github/workflows/edge.yml @@ -23,30 +23,7 @@ jobs: deno task build-production deno task build-plug-compile - name: Build Go binaries for multiple platforms - run: | - # Linux ARM64 - GOOS=linux GOARCH=arm64 go build -o silverbullet . - zip silverbullet-server-linux-aarch64.zip silverbullet - - # Linux x86_64 - GOOS=linux GOARCH=amd64 go build -o silverbullet . - zip silverbullet-server-linux-x86_64.zip silverbullet - - # macOS ARM64 - GOOS=darwin GOARCH=arm64 go build -o silverbullet . - zip silverbullet-server-darwin-aarch64.zip silverbullet - - # macOS x86_64 - GOOS=darwin GOARCH=amd64 go build -o silverbullet . - zip silverbullet-server-darwin-x86_64.zip silverbullet - - # Windows x86_64 - GOOS=windows GOARCH=amd64 go build -o silverbullet.exe . - zip silverbullet-server-windows-x86_64.zip silverbullet.exe - - # FreeBSD x86_64 - GOOS=freebsd GOARCH=amd64 go build -o silverbullet . - zip silverbullet-server-freebsd-x86_64.zip silverbullet + run: make build-server-releases - name: Update edge release uses: softprops/action-gh-release@v1 diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index 5b2fc36f..0c3bcdce 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -23,30 +23,7 @@ jobs: deno task build-production deno task build-plug-compile - name: Build Go binaries for multiple platforms - run: | - # Linux ARM64 - GOOS=linux GOARCH=arm64 go build -o silverbullet . - zip silverbullet-server-linux-aarch64.zip silverbullet - - # Linux x86_64 - GOOS=linux GOARCH=amd64 go build -o silverbullet . - zip silverbullet-server-linux-x86_64.zip silverbullet - - # macOS ARM64 - GOOS=darwin GOARCH=arm64 go build -o silverbullet . - zip silverbullet-server-darwin-aarch64.zip silverbullet - - # macOS x86_64 - GOOS=darwin GOARCH=amd64 go build -o silverbullet . - zip silverbullet-server-darwin-x86_64.zip silverbullet - - # Windows x86_64 - GOOS=windows GOARCH=amd64 go build -o silverbullet.exe . - zip silverbullet-server-windows-x86_64.zip silverbullet.exe - - # FreeBSD x86_64 - GOOS=freebsd GOARCH=amd64 go build -o silverbullet . - zip silverbullet-server-freebsd-x86_64.zip silverbullet + run: make build-server-releases - name: Release uses: softprops/action-gh-release@v1 env: diff --git a/Makefile b/Makefile index cb029597..3838903e 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,31 @@ +LDFLAGS = -X main.buildTime=$$(date -u +%Y-%m-%dT%H:%M:%SZ) + build: # Build client deno task build # Build plug-compile deno task build-plug-compile # Build server - go build + go build -ldflags "$(LDFLAGS)" build-for-docker: build - GOOS=linux GOARCH=arm64 go build -o silverbullet-arm64 . - GOOS=linux GOARCH=amd64 go build -o silverbullet-amd64 . + GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o silverbullet-arm64 . + GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o silverbullet-amd64 . docker: build-for-docker docker buildx build --platform linux/arm64,linux/amd64 --push . +build-server-releases: + GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o silverbullet . && zip silverbullet-server-linux-aarch64.zip silverbullet + GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o silverbullet . && zip silverbullet-server-linux-x86_64.zip silverbullet + GOOS=darwin GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o silverbullet . && zip silverbullet-server-darwin-aarch64.zip silverbullet + GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o silverbullet . && zip silverbullet-server-darwin-x86_64.zip silverbullet + GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o silverbullet.exe . && zip silverbullet-server-windows-x86_64.zip silverbullet.exe + GOOS=freebsd GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o silverbullet . && zip silverbullet-server-freebsd-x86_64.zip silverbullet + clean: rm -rf client_bundle/{base_fs,client} dist public_version.ts - rm -f silverbullet silverbullet-arm64 silverbullet-amd64 + rm -f silverbullet silverbullet-arm64 silverbullet-amd64 silverbullet.exe silverbullet-server-*.zip check: # Frontend type check diff --git a/client/markdown_renderer/inline.ts b/client/markdown_renderer/inline.ts index ea6c6e64..16a4659d 100644 --- a/client/markdown_renderer/inline.ts +++ b/client/markdown_renderer/inline.ts @@ -66,7 +66,7 @@ export async function expandMarkdown( const result = await inlineContentFromURL(space, transclusion); // We don't transclude anything that's not markdown - if (typeof result !== "string") { + if (!("text" in result)) { return n; } @@ -74,7 +74,7 @@ export async function expandMarkdown( // it so we won't touch it down the line and cause endless recursion processedPages.add(transclusion.url); - const tree = parseMarkdown(result); + const tree = parseMarkdown(result.text); // Recursively process return expandMarkdown( diff --git a/deno.json b/deno.json index 7101ae34..d4498562 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@silverbulletmd/silverbullet", - "version": "2.5.0", + "version": "2.5.1", "tasks": { "build": "make clean && deno run -A build_plugs_libraries.ts && deno run -A build_client.ts", "build-production": "deno task build --production", diff --git a/plugs/index/refactor.ts b/plugs/index/refactor.ts index 4bc8411d..6147301e 100644 --- a/plugs/index/refactor.ts +++ b/plugs/index/refactor.ts @@ -220,7 +220,7 @@ async function renamePage(oldName: string, newName: string) { let newTail = text.substring(link.pos); // Only relative links need to be updated - if (/^[^/][^\]]+?(? if link has spaces @@ -448,7 +448,7 @@ async function updateBacklinks( for (const link of linksInPage) { let newTail = text.substring(link.pos); let newLink = newName; - if (/^[^\]]+?(?