Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for empty lines in syntax highlighted code blocks #501

Merged
merged 1 commit into from
Nov 12, 2022

Conversation

hloeung
Copy link
Collaborator

@hloeung hloeung commented Nov 12, 2022

That is:

Testing

` ` ` go
package main

import "fmt"

func main() {
    fmt.Println("Hello, 世界")
}
` ` `
Testing end

Becomes:

|14:24 <hloeung> [@@pwxztbmprbgim8hsa5j9147jao] Testing
|14:24 <hloeung> [@@pwxztbmprbgim8hsa5j9147jao] ``` go
|14:24 <hloeung> [@@pwxztbmprbgim8hsa5j9147jao] package main
|14:24 <hloeung> [@@pwxztbmprbgim8hsa5j9147jao]
|14:24 <hloeung> [@@pwxztbmprbgim8hsa5j9147jao] import "fmt"
|14:24 <hloeung> [@@pwxztbmprbgim8hsa5j9147jao]
|14:24 <hloeung> [@@pwxztbmprbgim8hsa5j9147jao] func main() {
|14:24 <hloeung> [@@pwxztbmprbgim8hsa5j9147jao]     fmt.Println("Hello, 世界")
|14:24 <hloeung> [@@pwxztbmprbgim8hsa5j9147jao] }
|14:24 <hloeung> [@@pwxztbmprbgim8hsa5j9147jao] ```
|14:24 <hloeung> [@@pwxztbmprbgim8hsa5j9147jao] Testing end

That is, empty lines are preserved in syntax formatted code blocks much like plain non-syntax highlighted code blocks.

Without this, it is shown as follows:

|14:15 <hloeung> [@@nn86pumhs3bexpjwb757cyr86r] ``` go
|14:15 <hloeung> [@@nn86pumhs3bexpjwb757cyr86r] package main
|14:15 <hloeung> [@@nn86pumhs3bexpjwb757cyr86r] import "fmt"
|14:15 <hloeung> [@@nn86pumhs3bexpjwb757cyr86r] func main() {
|14:15 <hloeung> [@@nn86pumhs3bexpjwb757cyr86r]     fmt.Println("Hello, 世界")
|14:15 <hloeung> [@@nn86pumhs3bexpjwb757cyr86r] }
|14:15 <hloeung> [@@nn86pumhs3bexpjwb757cyr86r] ```

@hloeung hloeung changed the title Multi Support for empty lines in syntax highlighted code blocks Nov 12, 2022
@hloeung hloeung marked this pull request as ready for review November 12, 2022 03:49
@42wim 42wim added this to the v0.27.0 milestone Nov 12, 2022
@42wim 42wim merged commit 63d03de into 42wim:master Nov 12, 2022
@hloeung hloeung deleted the multi branch November 12, 2022 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants