Skip to content

Commit

Permalink
MFM検索でURLエンコード
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed May 27, 2019
1 parent 0395c69 commit 7757888
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/client/app/common/views/components/google.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default Vue.extend({
search() {
const engine = this.$store.state.settings.webSearchEngine ||
'https://www.google.com/?#q={{query}}';
const url = engine.replace('{{query}}', this.query)
const url = engine.replace('{{query}}', encodeURIComponent(this.query))
window.open(url, '_blank');
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/mfm/toHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export function toHtml(tokens: MfmForest, mentionedRemoteUsers: INote['mentioned

search(token) {
const a = doc.createElement('a');
a.href = `https://www.google.com/?#q=${token.node.props.query}`;
a.href = `https://www.google.com/?#q=${encodeURIComponent(token.node.props.query)}`;
a.textContent = token.node.props.content;
return a;
}
Expand Down

0 comments on commit 7757888

Please sign in to comment.