showdownjs / showdown

A bidirectional Markdown to HTML to Markdown converter written in Javascript
http://www.showdownjs.com/
MIT License
14.32k stars 1.57k forks source link

Code block inside a list with extra lines and spaces sometimes break #1014

Open AvikChakraborty18 opened 4 months ago

AvikChakraborty18 commented 4 months ago

Example:

  1. Bullet point:

    <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="X-UA-Compatible" content="IE=edge" />
            <meta charset="UTF-8" />
            <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    
            <script>
                window['sap-ushell-config'] = {
                    defaultRenderer: 'fiori2',
                    services: {
                        NavTargetResolution: {
                            config: {
                                allowTestUrlComponentConfig: true,
                                enableClientSideTargetResolution: true
                            }
                        }           
                    },
                    applications: {
                        "incidents-app": {
                            title: 'Incident-Management',
                            description: 'Incidents',
                            additionalInformation: 'SAPUI5.Component=ns.incidents',
                            applicationType: 'URL',
                            url: "./incidents/webapp",
                            navigationMode: 'embedded'
                        }
                }
            }
            </script>
            <script src="https://ui5.sap.com/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
            <script
                src="https://ui5.sap.com/resources/sap-ui-core.js"
                data-sap-ui-libs="sap.m, sap.ushell, sap.fe.templates"
                data-sap-ui-compatVersion="edge"
                data-sap-ui-theme="sap_horizon"
                data-sap-ui-frameOptions="allow"
                data-sap-ui-bindingSyntax="complex"
            ></script>
            <script>
                sap.ui.getCore().attachInit(function() {
                    sap.ushell.Container.createRenderer().placeAt('content');
                });
            </script>
        </head>
        <body class="sapUiBody" id="content"></body>
    </html>
  2. Same code rendering in showdown: Screenshot 2024-07-16 at 6 29 15 PM