Skip to content

Publish - Broken HTML Output #759

@zhangxueshan246

Description

@zhangxueshan246

Search first

  • I searched and no similar issues were found

What Happened?

When publishing a Logseq database-based graph, the generated HTML file contains malformed JavaScript that causes the published page to be blank in browsers.

Reproduce the Bug

  1. Use Logseq DB version 2102
  2. Create some pages with content and set publish all pages
  3. Use Logseq UI to publish (Export → Export Public Pages)
  4. Open the exported index.html file in a browser
  5. The page is blank and shows no content

Expected Behavior

The published HTML should display all pages and render correctly in the browser.

Files

Use my database to publish and push to https://github.com/zhangxueshan246/zhangxueshan246.github.io .
The page is blank and shows SQLiteDB error: Error: Cannot read properties of undefined (reading '$DB$')

Browser, Desktop or Mobile Platform Information

Additional Context

AI said:

  • Looking at the HTML source, the window.logseq_db variable is malformed:
    • Expected: window.logseq_db="[logseq_DB,{...}]"
    • Actual: window.logseq_db="[logseq____"~#datascript/DBlogseq____",[logseq____"^ logseq____",logseq____"~:schemalogseq____"...

The quotes are being mangled - " appears as literal text logseq____" in the output.

The serialization of the database to HTML is corrupting the quote characters. This needs to be fixed in the Logseq publish code for the DB version

Are you willing to submit a PR? If you know how to fix the bug.

  • I'm willing to submit a PR (Thank you!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions