Skip to content

Commit

Permalink
Merge pull request #191 from kaogeek/190-polishing-details-search-url…
Browse files Browse the repository at this point in the history
…-using-plus-see-moreless

#190 Polishing details - Search URL using plus, See more/less
  • Loading branch information
iampz authored Sep 6, 2024
2 parents f971b70 + 0fabacb commit 6926903
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/Sections.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ export default function Sections({ sections, search = null }) {
/>
</div>
{isShown &&
<button style={{ color: '#14a', border: '1px solid #bbb', padding: '3px 7px' }} onClick={() => setTopicIsExpanded(!isTopicExpanded)}>
{isTopicExpanded ? 'กดเพิ่ออ่านน้อยลง' : 'กดเพิ่ออ่านเพิ่มเติม'}
<button style={{ color: '#14a', textDecoration: 'underline' }} onClick={() => setTopicIsExpanded(!isTopicExpanded)}>
{isTopicExpanded ? 'อ่านน้อยลง' : 'อ่านเพิ่มเติม'}
</button>
}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default function Search({ searchInputValue, setSearchInputValue }) {
const [section, chapter] = item[1].split('|');
return (
<Link
to={"/section/" + item[0] + `/${searchInputValue}`}
to={"/section/" + item[0] + `/${searchInputValue.trim().replace(/\s/g, '+')}`}
onClick={() => saveHistory(searchInputValue)}
key={index}
state={{ backable: true }}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default function highlight(content, words='') {
}
return words
.trim()
.split(' ')
.split('+')
.reduce(
(hc, word) => hc.replace(
new RegExp(word, 'gi'),
Expand Down

0 comments on commit 6926903

Please sign in to comment.