Skip to content

Commit 9eb20a8

Browse files
authored
Correctly encode twitter sharing url (#935)
1 parent e3ddbcb commit 9eb20a8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## BUG FIXES
44

5+
- Correctly encode the document title when creating the twitter sharing link from a bookdown chapter (thanks, @maelle, #934).
6+
57
- Make sure `search_index.json` contains valid characters for the JSON format (thanks, @wlandau, #913).
68

79
## MINOR CHANGES

inst/resources/gitbook/js/plugin-sharing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
2323
'icon': 'fa fa-twitter',
2424
'onClick': function(e) {
2525
e.preventDefault();
26-
window.open("http://twitter.com/intent/tweet?text="+document.title+"&url="+encodeURIComponent(location.href)+"&hashtags=rmarkdown,bookdown");
26+
window.open("http://twitter.com/intent/tweet?text="+encodeURIComponent(document.title)+"&url="+encodeURIComponent(location.href)+"&hashtags=rmarkdown,bookdown");
2727
}
2828
},
2929
'linkedin': {

0 commit comments

Comments
 (0)