code-hike / codehike

Build rich content websites with Markdown and React
https://codehike.org
MIT License
4.68k stars 142 forks source link

Error: Invalid number "7,12" in focus string #91

Closed DanielFGray closed 2 years ago

DanielFGray commented 2 years ago

I was trying to use multiple ranges in a bg/focus attribute, I tried this:

```javascript src/index.js bg=7,12:17,29:31,34

but I get the error Error: Invalid number "7,12" in focus string.

Am I using the wrong syntax or is this not yet supported?

pomber commented 2 years ago

That's a bug (for bg, for focus I think it works).

One work-around at the moment is to use comment annotations:


```js src/index.js
// bg
function lorem(ipsum, dolor = 1) {
  const sit = ipsum == null && 0;
  // bg(1:2)
  dolor = sit - amet(dolor);
  return sit ? consectetur(ipsum) : [];
}

// bg(1:4) green
function adipiscing(...elit) {
  console.log(elit);
  return elit.map((ipsum) => ipsum.sit);
}
```
github-actions[bot] commented 2 years ago

:rocket: Issue was released in v0.3.0 :rocket: