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

Fixes displaying single newlines in output markdown and add renderer_options #5376

Merged
merged 5 commits into from
Aug 17, 2023

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented Aug 8, 2023

Fixes #5375
Before
image

After
image

Primary use case atm:
Langchain outputs newlines as \n so I have to do this:

    def on_llm_new_token(self, token: str, **kwargs) -> None:
        self._entry = self.chat_interface.stream(
            token.replace("\n", "<br>"), self._entry
        )
        return super().on_llm_new_token(token, **kwargs)

@ahuang11 ahuang11 changed the title Markdown newline Fixes displaying single newlines in output markdown Aug 8, 2023
@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Merging #5376 (a7694e8) into main (47c4a05) will decrease coverage by 10.08%.
Report is 3 commits behind head on main.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##             main    #5376       +/-   ##
===========================================
- Coverage   82.77%   72.70%   -10.08%     
===========================================
  Files         274      274               
  Lines       39861    39879       +18     
===========================================
- Hits        32996    28995     -4001     
- Misses       6865    10884     +4019     
Flag Coverage Δ
ui-tests ?
unitexamples-tests 72.70% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
panel/pane/markup.py 89.78% <100.00%> (+0.13%) ⬆️
panel/tests/pane/test_markup.py 99.42% <100.00%> (+0.04%) ⬆️
panel/widgets/base.py 92.52% <100.00%> (+0.07%) ⬆️

... and 59 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ahuang11 ahuang11 changed the title Fixes displaying single newlines in output markdown Fixes displaying single newlines in output markdown and add renderer_options Aug 9, 2023
@ahuang11 ahuang11 requested a review from MarcSkovMadsen August 9, 2023 17:03
@philippjfr
Copy link
Member

Looks good, but could you please also update the docs in the reference notebook?

@ahuang11
Copy link
Contributor Author

Added

@philippjfr
Copy link
Member

Thank you!

@philippjfr philippjfr merged commit 58fe54f into main Aug 17, 2023
@philippjfr philippjfr deleted the markdown_newline branch August 17, 2023 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Single newline \n in pn.pane.Markdown doesn't work
2 participants