Question · Vibe coding with Claude Code course · Module 12: Medium clone
An offset counted from the node
The paragraph "Tom is fine" already has the word "is" highlighted. The agent's version takes range.startOffset for the selected word "fine". What start will it get?
Answer options
- 7, because startOffset always counts from the start of the paragraph
- 1, because startOffset counts characters from the start of the text node " fine" after the <mark> tag, not from the start of the paragraph
- 0, because every new selection starts from zero
- -1, because a selection after a <mark> tag is invalid
You can check the correct answer by solving this task in the CodeWorlds game.