# Syntax Test Failures Report

**Date:** 2026-02-07
**Tests run:** 269
**Passed:** 267
**Failed:** 2

## Summary

After committing the inline text quote-stripping fix, 2 syntax tests are failing. Both failures are related to **IDs with dots**, not the inline text changes.

## Failing Tests

### 1. `id_with_dots`

**Input:**
```wasot
.div :page.header.logo
Logo content here.
```

**Expected:** `id = "page.header.logo"`
**Actual:** `id = "1"` (auto-generated), inline_text = `:page.header.logo`

### 2. `id_with_dots_for_namespacing`

**Input:**
```wasot
.section :docid.id
Namespaced content.
```

**Expected:** `id = "docid.id"`
**Actual:** `id = "1"` (auto-generated), inline_text = `:docid.id`

## Root Cause

The ID extraction regex in `src/parsers/wasot/parser.rs:199` **intentionally excludes dots**:

```rust
// Note: dots are NOT allowed in IDs (reserved for document.local-id references)
let pattern = r"\s:[A-Za-z0-9\-_:\p{L}]+\s*$";
```

This is confirmed by an existing test `test_ids_no_longer_allow_dots` (line 1802-1808):

```rust
#[test]
fn test_ids_no_longer_allow_dots() {
    // IDs with dots should NOT be extracted (dots reserved for document references)
    let (id, cleaned) = extract_id_string(".div text :has.dot");
    // The regex won't match because dots aren't allowed
    assert_eq!(id, "");
    assert_eq!(cleaned, ".div text :has.dot");
}
```

The dots are reserved for **document ID references** like `document-name.local-id` which are used for cross-document linking.

## Solutions

### Option A: Update the test expectations (Recommended)

Since dots are intentionally disallowed in IDs, update `tests/wasot_syntax_tests.md` to:

1. Either remove the tests for dotted IDs, or
2. Change them to test that dotted IDs are treated as inline text (the actual behavior)

**For `id_with_dots`:**
```yaml
- block-started:
    type: div
    level: 1
    inline-text: ":page.header.logo"
- text-finished:
    lines: ["Logo content here."]
- block-finished
```

**For `id_with_dots_for_namespacing`:**
```yaml
- block-started:
    type: section
    level: 1
    inline-text: ":docid.id"
- text-finished:
    lines: ["Namespaced content."]
- block-finished
```

### Option B: Use dashes instead of dots

Change the test inputs to use dashes instead of dots:

```wasot
.div :page-header-logo
```

This will work correctly since dashes are allowed in IDs.

### Option C: Allow dots in IDs (Not Recommended)

Modify the regex to include dots:

```rust
let pattern = r"\s:[A-Za-z0-9\-_:.\p{L}]+\s*$";
```

**Warning:** This would break the document reference feature where `document.local-id` has special meaning.

## Recommendation

Use **Option A** - update the test expectations to match the intended behavior. The tests are documenting incorrect expectations for a feature that was explicitly changed.

## Verification

```bash
# Shows dots are not allowed in IDs
echo '.div :page.header.logo' | cargo run --bin wasot -- -t jsonl | jq '.meta_line.id'
# Output: {"value":"1"}

# Shows dashes work fine
echo '.div :page-header-logo' | cargo run --bin wasot -- -t jsonl | jq '.meta_line.id'
# Output: {"value":"page-header-logo"}

# Shows the :page.header.logo becomes inline text
echo '.div :page.header.logo' | cargo run --bin wasot -- -t jsonl | jq '.meta_line.inline_text.content'
# Output: ":page.header.logo"
```
