jaypyles / obsidian-to-bookstack

Download and upload changes between an Obsidian Vault and a Bookstack instance.
MIT License
54 stars 7 forks source link

Some parts of the content not synced #9

Open Geronimoes opened 5 months ago

Geronimoes commented 5 months ago

When there is content in a page that occurs before the first header, all content up to and including that first header is not retrieved from BookStack. For example, given the following test page content:

*Content* before header, and <span style="color: rgb(224, 62, 45);">span styling</span>

### Header

Content after header.

Only the following is actually stored in the file when downloaded / updated to the client:

Content after header.

And when I add a header before that content like so:

##### Some header of any level

*Content* before header, and <span style="color: rgb(224, 62, 45);">span styling</span>

### Header

Content.

The result is:

*Content* before header, and <span style="color: rgb(224, 62, 45);">span styling</span>

### Header

Content.

I'm not 100% sure whether it's the span tags causing this behavior, or perhaps anything before and including the first header being skipped by default (by the script and/or the api). However, on a page that doesn't include any span content before the first header, it syncs as expected, including all content of the page.

I'm also noticing that when a span before the first header (or maybe anywhere in the page?) was added - causing the behavior described above - this behavior persists for that page even when any formatting that would trigger span classes has been removed and synced again. This makes me wonder whether it is caused by BookStack switching the page from markdown formatting to html (ie its editor options), but the resulting file does format as markdown - just with anything before the first header on the page missing.

Also, a minor issue: I noticed that while BookStack allows for pages with the same title in the same location, these duplicates are not synced. For example, if I have shelf/book/page-title twice (so same 'page-title'), but with different page contents, only one of these gets synced - it seems the first created page.

Geronimoes commented 5 months ago

To be sure: it seems to me that a page like this does sync the complete page, as long as there were never any span elements:

Some *markdown* formatted content that **doesn't** require html formatting like text color.

## First page header
Some content.

Edit: I tested this example. When I create a new page in BookStack (using the WYSIWYG editor on the BookStack instance website) and then run obsidian_to_bookstack local, it creates a file as expected:

Some *markdown* formatted content that **doesn't** require html formatting like text color.

## First page header

Some content.

However, when I then change the same page on the bookstack website and run update --local, the content gets dropped, leaving only anything after the first header:

Some content that was **edited**.

So it seems the issue isn't necessarily with as I thought, but rather with the update script.