8000 Change: Extend ManualLink to allow highlighting in the manual · greenbone/gsa@ae99d72 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit ae99d72

Browse files
committed
Change: Extend ManualLink to allow highlighting in the manual
Allow to set the highlight URL param when using a ManualLink component.
1 parent 1debb32 commit ae99d72

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/web/components/link/manuallink.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ import PropTypes from 'web/utils/proptypes';
1010

1111
import BlankLink from './blanklink';
1212

13-
const ManualLink = ({anchor, page, searchTerm, lang, ...props}) => {
13+
const ManualLink = ({anchor, page, searchTerm, lang, highlight, ...props}) => {
1414
const manualURL = useManualURL(lang);
1515

1616
let url = manualURL + '/' + page + '.html';
1717

1818
if (page === 'search' && isDefined(searchTerm)) {
1919
url += '?q=' + searchTerm;
20+
} else if (isDefined(highlight)) {
21+
url += '?highlight=' + highlight;
2022
} else if (isDefined(anchor)) {
2123
url += '#' + anchor;
2224
}
@@ -25,6 +27,7 @@ const ManualLink = ({anchor, page, searchTerm, lang, ...props}) => {
2527

2628
ManualLink.propTypes = {
2729
anchor: PropTypes.string,
30+
highlight: PropTypes.string,
2831
lang: PropTypes.string,
2932
page: PropTypes.string.isRequired,
3033
searchTerm: PropTypes.string,

0 commit comments

Comments
 (0)
0