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

Antisamy Removes carriage returns and line feeds #143

Open
GoogleCodeExporter opened this issue Apr 29, 2015 · 12 comments
Open

Antisamy Removes carriage returns and line feeds #143

GoogleCodeExporter opened this issue Apr 29, 2015 · 12 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create a file with carriage returns/line feeds
2. Run this.getAntiSamyPolicy()).getCleanHTML();
3. Result all carriage returns/line feeds are removed

What is the expected output? What do you see instead?

I would like to see carriage feeds/carriage returns remain in output.


What version of the product are you using? On what operating system?
1.4.4 Mac Os X, Version 10.7.5, also happens on windows 7

Please provide any additional information below.

I work for NASA, and we really need a solution to this problem. Is this 
happening in the policy file, or the java source code??

I have toggled a couple of fields in the policy files, and none have resulted 
in any changes.

Original issue reported on code.google.com by mbharri...@gmail.com on 1 Nov 2012 at 3:06

Attachments:

@GoogleCodeExporter
Copy link
Author

Can you please attach you policy directives?  The only way I could reproduce 
was using "preserveSpace=false".  

Original comment by tad...@gmail.com on 5 Nov 2012 at 10:52

@GoogleCodeExporter
Copy link
Author

What OS are you using? I'm on a MAC running lion, and nothing works for me.

Original comment by mbharri...@gmail.com on 5 Nov 2012 at 11:16

Attachments:

@GoogleCodeExporter
Copy link
Author

Also below are two links, that also are having the same issue. One article 
states that he used "preserveSpace="true", which I'm using and antisamy still 
removes the carriage returns.

https://lists.owasp.org/pipermail/owasp-antisamy/2008-July/000073.html
https://lists.owasp.org/pipermail/owasp-antisamy/2010-June/000321.html

Original comment by mbharri...@gmail.com on 5 Nov 2012 at 11:24

@GoogleCodeExporter
Copy link
Author

Sorry, I should have clarified.  You mentioned you were able to reproduce on 
Windows, and I was not able to reproduce on Windows.  I don't have access to a 
Mac to test/verify on that.

Original comment by tad...@gmail.com on 6 Nov 2012 at 2:52

@GoogleCodeExporter
Copy link
Author

Can you please try to use the antisamy-anythinggoes-1.4.4.xml file I have 
attached, and verify if it works in windows for me? 

Original comment by mbharri...@gmail.com on 6 Nov 2012 at 3:16

@vadooss1
Copy link

vadooss1 commented May 7, 2020

I have the same issue. When this issue will be fixed?

@davewichers
Copy link

This is a really old issue, obviously, and I've just started to help Arshan with maintenance of Antisamy. Just to confirm, does your Antisamy policy have: preserveSpace=true, and this still happens? And if it still happens, does it always happen regardless of content, or only if AntiSamy identifies something that needs to be removed?

@vadooss1
Copy link

vadooss1 commented May 7, 2020

preserveSpace=true, formatOutput=false are set. The issue happens always when multi lines text contains characters & < > " . The issue doesn't happen with any other special symbols.

@vadooss1
Copy link

vadooss1 commented May 8, 2020

I really ask you to help and fix this issue. Because user text input often has characters & < > " and antisamy changes text formatting removing new lines and carriages return when these characters are into the text. Saving text formatting is very significant for our system. Thanks a lot.

@nahsra
Copy link
Contributor

nahsra commented May 13, 2020

Can you provide a failing test case? I am not sure we have enough context to reproduce. I also don't know if the behavior you don't want is being caused parts of serialization that we don't control, so I want to temper your expectations.

@vadooss1
Copy link

vadooss1 commented May 14, 2020

Refer attachment.

  1. The image "after_submit.png" has lost formatting (screenshot was made after page was submitted)
  2. The image "before_submit.png" has formatting (screenshot was made before page submitting)

after_submit
before_submit

Note: for issue reproducing use characters "" & < in the input text

@davewichers
Copy link

@vadooss1 - Are you going to create a failing test case in the base AntiSamy project in github.com/nahsra so we know exactly what is going on/failing?

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

No branches or pull requests

4 participants