code-hike / codehike

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

[mdx] Focus comment not working #100

Closed pomber closed 2 years ago

pomber commented 2 years ago

The second comment in this snippet is not parsed as a focus annotation:

```rust
pub fn add(a: i32, b: i32) -> i32 {
    a + b
}
// focus(1:4)
#[allow(dead_code)]
fn bad_add(a: i32, b: i32) -> i32 {
    a - b
}
#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_add() {
        assert_eq!(add(1, 2), 3);
    }
    // focus(1:4)
    #[test]
    fn test_bad_add() {
        assert_eq!(bad_add(1, 2), 3);
    }
}
```