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

Factor out output_prompt_function, as is done with input prompt #2774

Merged
merged 2 commits into from Sep 15, 2017
Merged

Factor out output_prompt_function, as is done with input prompt #2774

merged 2 commits into from Sep 15, 2017

Conversation

@iamlemec
Copy link
Contributor

@iamlemec iamlemec commented Aug 17, 2017

This allows for much cleaner customization of the output prompt in custom.js, as is currently the case with the input prompt.

@takluyver takluyver added this to the 5.2 milestone Aug 18, 2017
@takluyver
Copy link
Member

@takluyver takluyver commented Aug 18, 2017

Thanks!

We're just trying to make a 5.1 release - I've marked this as 5.2 as it's probably not urgent enough to go in at the last minute. Hopefully we can merge it soon after the release.

Loading

@@ -467,6 +467,11 @@ define([
this.element.trigger('changed', {output_area: this});
};

OutputArea.output_prompt_classical = function(prompt_value) {
return '<bdi>'+i18n.msg.sprintf(i18n.msg._('Out[%d]:'),prompt_value)+'</bdi>';
Copy link
Member

@takluyver takluyver Sep 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this construct a node like the old code does, rather than assembling an HTML string? While I don't think there's a security concern here, it's good practice to use the safer style throughout.

Loading

Copy link
Contributor Author

@iamlemec iamlemec Sep 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, just made the change. Btw, the code for input_prompt_classical in codecell.js also uses an HTML string, so it might be worth changing that too.

Loading

@gnestor
Copy link
Contributor

@gnestor gnestor commented Sep 15, 2017

@iamlemec This looks good to me. I just re-ran the Travis build and it's passing now. @takluyver Is this ready to merge?

Loading

@takluyver
Copy link
Member

@takluyver takluyver commented Sep 15, 2017

Yup, I think so.

@iamlemec thanks, and thanks for checking the input prompt method. If you want to make a separate PR to update that to create an element, I think we could merge that.

Loading

@takluyver takluyver merged commit 9dabaa2 into jupyter:master Sep 15, 2017
4 checks passed
Loading
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants