fix non-indented markdown code blocks

We have fixed cases where markdown code blocks were not properly intended.

Updated `markdown.md` to discuss how markdown code blocks should be indented
and how blank lines should follow a markdown code block.

We used this shell script to find problematic code blocks:

```sh
find . -name '*.md' ! -name markdown.md -print | xargs pcregrep -M '^``.*\n[^|`\n \t]'
```

Ran `make www` to perform the above.
This commit is contained in:
Landon Curt Noll committed 2024-04-30 17:24:50 -07:00
1 parent a507a06076
commit b1516f0ed9
29 files changed
+357 -213

No files matched your search

+55 -2
View File
@@ -163,7 +163,7 @@ If a short line is needed, use:
## Do not use the strike HTML element
Please not use the HTML element:
Please not use HTML elements:
```
<strike>...</strike> <=== no thank you
@@ -176,7 +176,7 @@ Use instead:
```
## Do not use tt HTML elements
## Do not use the tt HTML element
Please do not use the tt HTML elements:
@@ -217,6 +217,22 @@ We request that you indent the code block by 4 spaces:
```
````
One exception is where change bars are needed, such as
those used in `next/rules.md` and in `next/guidelines.md`.
For example, `next/guidelines.md` uses this markdown code block:
````
```
main() {
| void please_do_not_submit_this() {
| printf("The machine that goes BING!\n");
}
| please_do_not_submit_this();
}
```
````
## Do not add trailing slash on void HTML elements
@@ -303,6 +319,43 @@ Use:
```
## Do not place text on the next line after a markdown code block
Please do not place text on the next line after a markdown code block.
Instead, place a blank line after the end of a markdown code block
is this makes it easier to detect when markdown code blocks are
not properly indented.
Instead of:
````
```
int
main(int foo)
{
return foo;
}
```
C compilers cannot be given a -Wno-main-arg-errors flag. <=== no thank you
````
Use:
````
```
int
main(int foo)
{
return foo;
}
```
C compilers cannot be given a -Wno-main-arg-errors flag.
BTW: Not the blank line after the code block.
````
## Do not put ('s or )' markdown link titles
Please do not use parenthesis inside the markdown link titles.