Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
5d482b47
Commit
5d482b47
authored
Mar 09, 2022
by
Robert Knight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a couple of explanatory comments requested in code review
parent
01431523
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
html.js
src/annotator/anchoring/html.js
+1
-0
settings.js
src/annotator/config/settings.js
+5
-1
No files found.
src/annotator/anchoring/html.js
View file @
5d482b47
...
@@ -67,6 +67,7 @@ export function anchor(root, selectors, options = {}) {
...
@@ -67,6 +67,7 @@ export function anchor(root, selectors, options = {}) {
let
promise
=
Promise
.
reject
(
'unable to anchor'
);
let
promise
=
Promise
.
reject
(
'unable to anchor'
);
if
(
range
)
{
if
(
range
)
{
// Const binding assures TS that it won't be re-assigned when callback runs.
const
range_
=
range
;
const
range_
=
range
;
promise
=
promise
.
catch
(()
=>
{
promise
=
promise
.
catch
(()
=>
{
let
anchor
=
RangeAnchor
.
fromSelector
(
root
,
range_
);
let
anchor
=
RangeAnchor
.
fromSelector
(
root
,
range_
);
...
...
src/annotator/config/settings.js
View file @
5d482b47
...
@@ -16,7 +16,11 @@ import { urlFromLinkTag } from './url-from-link-tag';
...
@@ -16,7 +16,11 @@ import { urlFromLinkTag } from './url-from-link-tag';
* @prop {(name: string) => unknown} hostPageSetting
* @prop {(name: string) => unknown} hostPageSetting
*/
*/
/** @param {unknown} value */
/**
* Discard a setting if it is not a string.
*
* @param {unknown} value
*/
function
checkIfString
(
value
)
{
function
checkIfString
(
value
)
{
return
typeof
value
===
'string'
?
value
:
null
;
return
typeof
value
===
'string'
?
value
:
null
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment