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

Allow users to make new paragraphs in comments #158

Closed
tetron432 opened this issue Feb 3, 2021 · 5 comments · Fixed by #169
Closed

Allow users to make new paragraphs in comments #158

tetron432 opened this issue Feb 3, 2021 · 5 comments · Fixed by #169
Assignees
Labels
Milestone

Comments

@tetron432
Copy link

Proposed Functionality

In the comments currently, the library doesn't allow the users to make a new comment by hitting enter twice- everything instead is on a single line. Can you please make it so that when a user makes a comment in the preview, and tries to make a new paragraph, it also shows up when they post it as well?

Preview of comment
Screen Shot 2021-02-03 at 9 20 00 AM

What the comment look like when the user makes a post
Screen Shot 2021-02-03 at 9 20 13 AM

@Radi85
Copy link
Owner

Radi85 commented Feb 4, 2021

Hi @tetrahed,

This should be covered in #153.

@abhiabhi94
Copy link
Collaborator

I think this can be covered independently of the markdown thing.

If the developer doesn't want to wrap the contents of the each comment, maybe we can introduce a new setting with the name COMMENT_ALLOW_CONTENT_WRAP or something similar. It would bypass the current functionality when rendering comments, if not required.

From the top of my head without consider anything else I think, if required, we might only have to touch the function below:

def render_content(comment, number):
number = int(number)
content = comment.content
content_words = content.split()
if not number or len(content_words) <= number:
text_1 = content
text_2 = None
else:
text_1 = ' '.join(content_words[:number])
text_2 = ' '.join(content_words[number:])
return {
'text_1': text_1,
'text_2': text_2,
'urlhash': comment.urlhash
}

@abhiabhi94
Copy link
Collaborator

On second thoughts, we may also not wrap the contents when number is None.

This will allow the functionality to be implemented without adding another extra setting value but may have issues with backward compatibility.

@Radi85
Copy link
Owner

Radi85 commented Feb 6, 2021

On second thoughts, we may also not wrap the contents when number is None.

This will allow the functionality to be implemented without adding another extra setting value but may have issues with backward compatibility.

The current implementation is intended to use the setting variable. I found it more convenient than extending the template for this purpose.

@abhiabhi94
Copy link
Collaborator

The current implementation is intended to use the setting variable. I found it more convenient than extending the template for this purpose.

Okay adding a new setting seems the more acceptable solution to this then.

Hey @tetrahed, would you be interested in working on this issue? If yes, and you run into any kind of problems or anything feel free to ask them here or hopefully in a pull request :)

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

Successfully merging a pull request may close this issue.

3 participants