Compare commits
3 Commits
2d442bcbde
...
ceffb434fe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ceffb434fe | ||
|
|
59eea6d232 | ||
|
|
8349ef42db |
@ -77,14 +77,12 @@ If you prefer a formatted HTML website with search, themes, and copy buttons, bu
|
||||
### Prerequisites
|
||||
|
||||
```bash
|
||||
bash
|
||||
cargo install mdbook
|
||||
```
|
||||
|
||||
### Build & Serve
|
||||
|
||||
```bash
|
||||
bash
|
||||
# Navigate to docs directory
|
||||
cd provisioning/docs
|
||||
|
||||
|
||||
2
platform
2
platform
@ -1 +1 @@
|
||||
Subproject commit 7d720948b707f4f8ce8bd57de552fbeb08909620
|
||||
Subproject commit cbc77ec5eed7317da95dc3a6c5961d11a1dd6509
|
||||
@ -68,7 +68,7 @@ def main [
|
||||
|
||||
# Phase 0: Fix literal \n escape sequences (Nushell - SAFE)
|
||||
if ($phase == "newlines" or $phase == "all") {
|
||||
if ($modified_content | str contains '\\n') {
|
||||
if ($modified_content | str contains '\n') {
|
||||
let newlines_result = fix-literal-newlines $modified_content
|
||||
$newlines_fixed = $newlines_result.fixed_count
|
||||
$total_newlines_fixed += $newlines_fixed
|
||||
@ -142,46 +142,18 @@ def main [
|
||||
# Fix literal \n escape sequences → actual newlines
|
||||
def fix-literal-newlines [content] {
|
||||
{
|
||||
content: ($content | str replace -a '\\n' "\n")
|
||||
content: ($content | str replace -a '\n' "\n")
|
||||
fixed_count: 1
|
||||
}
|
||||
}
|
||||
|
||||
# Clean up corrupted {$detected_lang} literals and remnant text lines
|
||||
# Clean up corrupted {$detected_lang} literals only (preserve structure and blanks)
|
||||
def cleanup-corrupted-fences [content] {
|
||||
let lines = $content | lines
|
||||
mut fixed_lines = []
|
||||
mut fixed_count = 0
|
||||
|
||||
for idx in (0..<($lines | length)) {
|
||||
let line = $lines | get $idx
|
||||
|
||||
# Check for corrupted opening fence with {$detected_lang}
|
||||
if ($line =~ '^```\{?\$detected_lang\}?$') {
|
||||
# Replace with clean ```
|
||||
$fixed_lines = ($fixed_lines | append '```')
|
||||
$fixed_count += 1
|
||||
} else {
|
||||
# Check if this is a remnant "text" line after a language-tagged opening fence
|
||||
let is_text_remnant = (
|
||||
$idx > 0 and
|
||||
($lines | get ($idx - 1)) =~ '^```\w+' and
|
||||
$line == 'text'
|
||||
)
|
||||
|
||||
if $is_text_remnant {
|
||||
# Skip this garbage line
|
||||
$fixed_count += 1
|
||||
} else {
|
||||
# Keep the line
|
||||
$fixed_lines = ($fixed_lines | append $line)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let had_corruption = $content | str contains '```{$detected_lang}'
|
||||
let fixed_content = $content | str replace -a '```{$detected_lang}' '```'
|
||||
{
|
||||
content: ($fixed_lines | str join "\n")
|
||||
fixed_count: $fixed_count
|
||||
content: $fixed_content
|
||||
fixed_count: (if $had_corruption { 1 } else { 0 })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user