Skip to content

Wrong code block output? #263

Description

@gopar
import markdown2
text = """
```
- (void)openWebsocketWithURL:(NSURL *)url {

    // Create a security policy that enforces SSL validation
    SRSecurityPolicy *securePolicy = [[SRSecurityPolicy alloc] initWithCertificateChainValidationEnabled:YES];
}
```
"""
print(markdown2.markdown(text))

Produces the following:

<p>```
- (void)openWebsocketWithURL:(NSURL *)url {</p>

<pre><code>// Create a security policy that enforces SSL validation
SRSecurityPolicy *securePolicy = [[SRSecurityPolicy alloc] initWithCertificateChainValidationEnabled:YES];
</code></pre>

<p>}
```</p>

From what I understand it should produce everything inside a code tag and no pre tag like so:

text = "``` a = 90 ```"
print(markdown2.markdown(text))
# Prints out
# <p><code>a = 90</code></p>

Am I incorrect or am I missing something?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions