Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code between < and > in code blocks disappears when opened for editing #1292

Closed
ilyapopov opened this issue Mar 9, 2022 · 6 comments · Fixed by #1426
Closed

Code between < and > in code blocks disappears when opened for editing #1292

ilyapopov opened this issue Mar 9, 2022 · 6 comments · Fixed by #1426

Comments

@ilyapopov
Copy link

When creating a comment, I can type code containing <...> within a backtick code clock. However, when I open this comment for editing, code between < and > disappears.

@paskal paskal added the bug label Mar 27, 2022
@paskal
Copy link
Collaborator

paskal commented Mar 27, 2022

Couldn't reproduce it on the current version.
image
image
Could you please try to reproduce it on the https://remark42.com/demo/, and if you can, try different browsers just to rule out if it's front-end of back-end issue?

@ilyapopov
Copy link
Author

I have just reproduced it on demo site. I entered

`foo<bar>`

and after I clicked "edit" I see

`foo`

My browser is Firefox 98.0.2 on Linux. I have also reproduced it on Chromium 99.0.4844.84

@paskal
Copy link
Collaborator

paskal commented Jun 12, 2022

I can reproduce it on https://remark42.com/demo/ and I don't see any requests sent to the backend before the text appears on screen, I assume that might be a frontend bug. @akellbl4 can you please look into it?

@paskal paskal added this to the v1.10.2 milestone Jun 12, 2022
@akellbl4
Copy link
Collaborator

akellbl4 commented Jul 10, 2022

@paskal it's backend related. Probably backend sanitizing HTML tags.
We send comment text as it is to the backend.

FE sends right data:
Screen Shot 2022-07-10 at 12 56 28 PM

BE returns without part of the text:
Screen Shot 2022-07-10 at 1 04 26 PM

@akellbl4
Copy link
Collaborator

akellbl4 commented Jul 10, 2022

@paskal okay, I figured out the problem that is described.
It's still the BE related in this case.
I have text with the whole content and orig without part of the content.

IMAGE 2022-07-10 13:11:14

@paskal
Copy link
Collaborator

paskal commented Jul 13, 2022

The issue's root cause is the following line:

c.Orig = p.Sanitize(c.Orig)

We need to figure out if we want to sanitize the "orig" field or if it's okay to leave it as-is as the "text" is already sanitised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants