logseq / logseq

A privacy-first, open-source platform for knowledge management and collaboration. Download link: http://github.com/logseq/logseq/releases. roadmap: http://trello.com/b/8txSM12G/roadmap
https://logseq.com
GNU Affero General Public License v3.0
30.07k stars 1.76k forks source link

Markdown file content not showing in Logseq #11256

Closed rubisco57 closed 3 weeks ago

rubisco57 commented 3 weeks ago

Search first

What Happened?

Many pages, seemingly arbitrary ones, do not display their content that is present in the underlying markdown file. This bug can induce data loss if the apparently empty page is edited and the actual content on disk overwritten. Tried re-indexing, refreshing, emptying cache.

Reproduce the Bug

Unfortunately I have not figured out how to determine which pages are affected, neither why and nor how to fix them manually.

Expected Behavior

No response

Screenshots

No response

Desktop or Mobile Platform Information

I am using Logseq 0.10.8 on Windows 10, Version 10.0.19045

Additional Context

No response

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

andelf commented 3 weeks ago

Logseq's markdown is not fully compatible with standard markdown(CommonMark or GFM). Could you provide a demo of your markdown use case?

rubisco57 commented 3 weeks ago

Thank you, andelf, for following up on this issue. Please find the copy of an affected page (md file) attached. Note that I did not modify the affected pages with an external editor. logseq-citation-manager_templatePage.md

andelf commented 3 weeks ago

This seems to be a template for a third-party extension.

rubisco57 commented 3 weeks ago

Spot on, andelf, renaming the title:: tag on one of the affected pages remedied the issue. Some questions remain, I would thank you for an answer.

  1. How to debugged this, i.e. to see that logseq opens a new (empty) page as specified in title:: but tries to overwrite the file associated to the page's original title?
  2. When did title:: become a reserved property and how to keep track of those reserved properties? Because for some time the usage of title:: did not cause any problems.
  3. Can I somehow reduce a property's namespace to another property, e.g. type:: so that when type:: is present in the same block, title:: refers to type.title?
andelf commented 3 weeks ago

How to debugged this, i.e. to see that logseq opens a new (empty) page as specified in title:: but tries to overwrite the file associated to the page's original title?

Normally Logseq will warn when renaming to an existing file name or automatically merge the content. By clicking and editing the top "page property" area, you will see the hidden "title::" property.

a reserved property and how to keep track of those reserved properties

It's defined in the codebase. In the future, all system property will have a logseq. prefix, which is under development.

(defn editable-built-in-properties
  "Properties used by logseq that user can edit"
  []
  (set/union #{:title :icon :template :template-including-parent :public :filters :exclude-from-graph-view
               :logseq.query/nlp-date
          ;; org-mode only
               :macro :filetags}
             editable-linkable-built-in-properties
             editable-view-and-table-properties))

(def built-in-property-types
  "Types for built-in properties. Built-in properties whose values are to be
  parsed by gp-text/parse-non-string-property-value should be added here"
  {:template-including-parent :boolean
   :public :boolean
   :exclude-from-graph-view :boolean
   :logseq.query/nlp-date :boolean
   :heading :boolean
   :collapsed :boolean
   :created-at :integer
   :created_at :integer
   :updated-at :integer
   :last-modified-at :integer
   :last_modified_at :integer
   :query-table :boolean
   :query-sort-desc :boolean
   :hl-page :integer
   :hl-stamp :integer
   :todo :integer
   :doing :integer
   :now :integer
   :later :integer
   :done :integer})

Can I somehow reduce a property's namespace to another property, e.g. type:: so that when type:: is present in the same block, title:: refers to type.title?

It's a complex naming logic. So it won't be available in the UI. With Query, you can collect all those pages and list their preferred names as query result list or table.

rubisco57 commented 3 weeks ago

Again, thank you, andelf! I am surprised to not find the alias in this list. Based on your explanations, I replaced the title:: command in all files making troubles and just removed the alias:: tag since it was not working properly due to commas in the strings used as aliases even if those where wrapped in quotes.