-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix #504 : honor the indentation in the MetadataFilter formatting #510
Conversation
self.current_chat["metadata"]["input"] | ||
) | ||
) | ||
.replace("\n", "<br>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we able to remove this given that <pre>
should honor line breaks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's indeed the first thing I have tried, but no.
<pre>
does not natively honor line breaks. It can be done with CSS but then the line breaks at the first opportunity, and it doesn't result in a hierarchical result anymore.
) | ||
) | ||
.replace("\n", "<br>") | ||
.replace(" ", " ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.replace("\n", "<br>")
We need to put explicit <br>
to have line-breaks at the right places, as explained in the other comment.
.replace(" ", " ")
We need to replace the whitespaces as explicit non-breakable spaces to show indentation, otherwise it's ignored.
Try removing these lines to see how it behaves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So do we even need the <pre>
tag in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Pierre!
Fix #504 : honor the indentation in the MetadataFilter formatting