wiki icon indicating copy to clipboard operation
wiki copied to clipboard

Pages with markdown comments not updating

Open arnerb opened this issue 5 years ago • 11 comments

Description

👉 edit: see comment below for actual cause

Single pages in the wiki are not updating anymore (2 pages out of about 100 so far)

Changes are visible in markdown preview and page source (markdown), but not in the actual live wiki view / reading mode.

Troubleshooting attempts

1. Copy content to new page

I tried to create a new page and add the same markdown content, but immediately upon creation and closing edit mode I get redirected to a screen with

Error while fetching page. Duplicate entry detected. Reload the page to try again.

Screen Shot 2021-04-22 at 19 45 02

2. Remove, then re-add content

  • copy markdown, remove entire content, add some text instead (one line)
  • page finally updates (works)
  • return to edit and add original markdown back --> page does not update anymore

to do: incrementally add original markdown (piece by piece) and see when page breaks / stops updating (see comment below)

System Infos

Screen Shot 2021-04-22 at 19 52 16

Question

What could be causing this? (sorry for limited information to reproduce. I will update if I find out more)

arnerb avatar Apr 22 '21 18:04 arnerb

Update

Seems like wiki does not allow comments in markdown (removing these solved updating issue for both pages).
I was using the following comment formatting:

<!---
markdown comment here 
blablabla
--->

Possible fixes

  • UI fix: Markdown editor gives a warning when adding comments in this format
  • Actual fix: Allow these types of comments to be added in markdown and still render page correctly

arnerb avatar Apr 22 '21 18:04 arnerb

We have the same issue where a page seemingly had the correct LAST EDITED BY field showing Today at 9:30 AM, but the updates made were not shown when the page was rendered. Following.

tjansson60 avatar Apr 23 '21 07:04 tjansson60

Not the right solution but I was able to hide a block of content using a <div> with a class, witch this class has the display: none propriety.

marcela-fernanda avatar Apr 28 '21 13:04 marcela-fernanda

I concur - if a markdown page has an HTML comment embedded, the page will fail to render. In my case, for a succesful page the server reports:

2021-05-02T11:40:51.136Z [JOB] info: Rendering page ID 40...
2021-05-02T11:40:52.180Z [JOB] info: Using database driver pg for postgres [ OK ]
2021-05-02T11:40:55.703Z [JOB] info: Rendering page ID 40: [ COMPLETED ]
2021-05-02T11:40:55.790Z [MASTER] info: (STORAGE/DISK) Updating file [en] path/to/wikipage...

While a failing page (the same page and content with an added HTML comment - "<!-- XXX -->") reports:

2021-05-02T11:41:10.761Z [JOB] info: Rendering page ID 40...
2021-05-02T11:41:11.759Z [JOB] info: Using database driver pg for postgres [ OK ]
2021-05-02T11:41:13.046Z [JOB] error: Rendering page ID 40: [ FAILED ]
2021-05-02T11:41:13.047Z [JOB] error: Cannot read property 'type' of undefined
2021-05-02T11:41:13.078Z [MASTER] info: (STORAGE/DISK) Updating file [en] path/to/wikipage...

The rendering also fails for previously-successful pages with embedded comments, so this would appear to be a small regression, introduced sometime between 2.5.159 and 2.5.201.

Some relevant discussion has occurred here: #3709.

DavidRawling avatar May 02 '21 11:05 DavidRawling

I can also confirm this issue, however, the UI does not report any kind of render error.

Pickysaurus avatar May 02 '21 18:05 Pickysaurus

I also have this problem. But not all sites seem to have this problem. 20% or so

$ find . -iname '*.md' | wc -l
1408
$ git grep -i --name-only '<!--' -- '*.md' | wc -l
693

silvio avatar May 11 '21 08:05 silvio

I concur - if a markdown page has an HTML comment embedded, the page will fail to render. In my case, for a succesful page the server reports:

2021-05-02T11:40:51.136Z [JOB] info: Rendering page ID 40...
2021-05-02T11:40:52.180Z [JOB] info: Using database driver pg for postgres [ OK ]
2021-05-02T11:40:55.703Z [JOB] info: Rendering page ID 40: [ COMPLETED ]
2021-05-02T11:40:55.790Z [MASTER] info: (STORAGE/DISK) Updating file [en] path/to/wikipage...

While a failing page (the same page and content with an added HTML comment - "") reports:

2021-05-02T11:41:10.761Z [JOB] info: Rendering page ID 40...
2021-05-02T11:41:11.759Z [JOB] info: Using database driver pg for postgres [ OK ]
2021-05-02T11:41:13.046Z [JOB] error: Rendering page ID 40: [ FAILED ]
2021-05-02T11:41:13.047Z [JOB] error: Cannot read property 'type' of undefined
2021-05-02T11:41:13.078Z [MASTER] info: (STORAGE/DISK) Updating file [en] path/to/wikipage...

The rendering also fails for previously-successful pages with embedded comments, so this would appear to be a small regression, introduced sometime between 2.5.159 and 2.5.201.

Some relevant discussion has occurred here: #3709.

I have the same problem, this may be a bug on Wiki.js 2.5.201 (upgrade from 2.5.170)

vincentruan avatar May 13 '21 12:05 vincentruan

I have the same problem and I would need the "real fix"; the comments are added by a third-party editor (stackedit) and they are crucial there.

martinkoutecky avatar May 16 '21 11:05 martinkoutecky

I have a Blog in which in comment box show that you can comment by using your Facebook profile. How can i remove this?

noorwali111 avatar May 18 '21 11:05 noorwali111

This was fixed by a recent PR. A new build will be released soon but in the meantime you can use this docker image:

requarks/wiki:canary-2.5.206

or apply the patch directly: https://github.com/Requarks/wiki/pull/3823/files

NGPixel avatar Jun 02 '21 01:06 NGPixel

@NGPixel : "This was fixed by a recent PR. A new build will be released soon but in the meantime you can use this docker image:"

When is soon? This was 3 months ago. I'm at 2.5.201. I got bit by this over the past week. Wasted 4 days trying to figure out what was going on. :(

BTW: Love the Wiki!

rrrevin avatar Sep 03 '21 15:09 rrrevin