Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Is it possible to create a new markdown render in the future? #528

Closed
Samtoto opened this issue Aug 6, 2020 · 3 comments
Closed

Is it possible to create a new markdown render in the future? #528

Samtoto opened this issue Aug 6, 2020 · 3 comments
Labels
question General questions about the project or usage

Comments

@Samtoto
Copy link

Samtoto commented Aug 6, 2020

Description
Is it possible to create a new markdown render in the future?
Consider such a situation:
The user wants to edit the submitted markdown document, not the parsed html document.

Example

    $markdown = <<<EOT
    ```html
    <?php
    class A() {}
    ?>
    <script>alert('safe')</script>
    ```
    <script>alert('XSS')</script>
    EOT;

    $commonMask = new CommonMarkConverter(
        ['html_input' => 'strip', 'allow_unsafe_links' => false],
    );

    $cleanedMarkdown = $commonMask->convertToMarkdown($markdown);
    echo $cleanedMarkdown; // String
    // Expect output:

    '''
    ```html
    &lt;?php
    class A() {}
    ?&gt;
    &lt;script&gt;alert('safe')&lt;/script&gt;
    ```
    '''
@Samtoto Samtoto added the enhancement New functionality or behavior label Aug 6, 2020
@Samtoto
Copy link
Author

Samtoto commented Aug 6, 2020

Found a similar issue #141

@colinodell colinodell added question General questions about the project or usage and removed enhancement New functionality or behavior labels Aug 6, 2020
@colinodell
Copy link
Member

Can you save the Markdown document in a database and then re-render it later when it is changed?

@Samtoto
Copy link
Author

Samtoto commented Aug 7, 2020

Yes, I changed my workflow, return the original content to owener, and return the parsed content to the other users.Thx a lot!

@Samtoto Samtoto closed this as completed Aug 7, 2020
@thephpleague thephpleague locked and limited conversation to collaborators Jun 12, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question General questions about the project or usage
Projects
None yet
Development

No branches or pull requests

2 participants