Skip to content

Commit a56f211

Browse files
authored
fix: make code example in issue template copy-paste-able (#278)
1 parent 91041d4 commit a56f211

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.github/ISSUE_TEMPLATE/CODING-GUIDELINE.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,14 @@ body:
160160
**Hidden lines:** If your code needs `use` statements, a `fn main()` wrapper, or other boilerplate to compile, but you don't want them shown in the documentation, prefix those lines with `# ` (hash + space). These lines will be compiled but hidden in the rendered docs.
161161
162162
Example with hidden lines:
163+
````
163164
```rust
164165
# use std::mem::MaybeUninit;
165166
# fn main() {
166167
let x: u32 = unsafe { MaybeUninit::uninit().assume_init() }; // UB
167168
# }
168169
```
170+
````
169171
placeholder: |
170172
```rust
171173
# use std::collections::HashMap;
@@ -193,13 +195,15 @@ body:
193195
**Hidden lines:** If your code needs `use` statements, a `fn main()` wrapper, or other boilerplate to compile, but you don't want them shown in the documentation, prefix those lines with `# ` (hash + space). These lines will be compiled but hidden in the rendered docs.
194196
195197
Example with hidden lines:
198+
````
196199
```rust
197200
# use std::collections::HashMap;
198201
# fn main() {
199202
let mut map = HashMap::new();
200203
map.insert("key", "value"); // Compliant usage
201204
# }
202205
```
206+
````
203207
placeholder: |
204208
```rust
205209
# fn main() {

0 commit comments

Comments
 (0)