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

Page is empty on specific Content #253

Open
dschiller opened this issue Nov 18, 2020 · 3 comments
Open

Page is empty on specific Content #253

dschiller opened this issue Nov 18, 2020 · 3 comments
Projects

Comments

@dschiller
Copy link

dschiller commented Nov 18, 2020

Describe the bug
the *.md Page is empty if a specific Content is provided.

To Reproduce
Steps to reproduce the behavior:

  1. Create test.md
  2. Add following Content:
'''json
{
    "Machine": {
        "Name": "Sum",
        "Database": {
            "_Comment_Type_Values": "Microsoft, Mysql",
            "Type": "Microsoft",
            "DSN32": "[Machine.Name]",
            "DSN64": "[Machine.Name]",
            "Server": "BuildApp",
            "Name": "[Machine.Name]",
            "User": "rooty",
            "Password": "srat"
        },
        "Services": {
            "User": "[Machine.Name]\\root",
            "Password": "srat"
        }
    },
    "Software": {
        "_Comment_Question_Values": "yes, no",
        "_Comment_Language_Values": "de, en",
        "Language": "de",
        "Versions": {
            "Renkel": "1.4.5",
            "RenkelMockup": "[Software.Versions.Renkel]",
            "Culat": "[Software.Versions.Renkel]",
            "Firet": "[Software.Versions.Renkel]",
            "X": "3.2.5"
        },
        "Installer": {
            "Location": "Tam",
            "_Comment_Section_Values": "RTZ, AE, RR, RS",
            "Section": "RTZ",
            "Retrieve": {
                "Renkel": "yes",
                "RenkelMockup": "[Software.Installer.Retrieve.Renkel]",
                "Culat": "[Software.Installer.Retrieve.Renkel]",
                "Firet": "[Software.Installer.Retrieve.Renkel]",
                "X": "[Software.Installer.Retrieve.Renkel]"
            },
            "Execute": {
                "Renkel": "yes",
                "RenkelMockup": "[Software.Installer.Execute.Renkel]",
                "Culat": "[Software.Installer.Execute.Renkel]",
                "Firet": "[Software.Installer.Execute.Renkel]",
                "X": "[Software.Installer.Execute.Renkel]"
            }
        },
        "Renkel": {
            "Installer": {
                "Execute": "[Software.Installer.Execute.Renkel]",
                "Version": "[Software.Versions.Renkel]",
                "Retrieve": {
                    "Execute": "[Software.Installer.Retrieve.Renkel]",
                    "_Comment_Location_Values": "Tam, Floc",
                    "Location": "[Software.Installer.Location]",
                    "_Comment_Section_Values": "RTZ, AE, RR, RS",
                    "Section": "[Software.Installer.Section]"
                },
                "Data": {
                    "_Comment_Default_Values": "If a Textbox, Radio Button, Checkbox Value is empty",
                    "_Comment_Checkbox_Values": "true, false",
                    "ChooseLanguage": "[Software.Language]",
                    "DestinationFolderPage": {
                        "Drive": "",
                        "Folder": ""
                    },
                    "SetupTypePage": {
                        "_Comment_Type_Values": "Complete, Custom",
                        "Type": ""
                    },
                    "TCPIPPortConfigurationPage": {
                        "AagtwyPort": "",
                        "DatabaseAEtewayPort": "",
                        "TextSeaRRhPort": "",
                        "ReportPort": "",
                        "StartPort": "5500"
                    },
                    "LogonInformationForTheLampertServicePage": {
                        "UserName": "[Machine.Services.User]",
                        "Password": "[Machine.Services.Password]"
                    },
                    "DatabaseConfigurationPage": {
                        "_Comment_DatabaseType_Values": "Microsoft, Mysql",
                        "DatabaseType": "[Machine.Database.Type]",
                        "DSN64": "[Machine.Database.DSN64]"
                    },
                    "BlenderLoginPage": {
                        "Database": {
                            "UserName": "[Machine.Database.User]",
                            "Password": "[Machine.Database.Password]"
                        },
                        "ODBC": {
                            "AEtewayHost": "",
                            "UserName": "",
                            "Password": ""
                        }
                    },
                    "RenderLoginPage": {
                        "Database": {
                            "UserName": "",
                            "Password": ""
                        },
                        "ODBC": {
                            "AEtewayHost": "",
                            "UserName": "",
                            "Password": ""
                        }
                    },
                    "RenderRonfigurationPage": {
                        "NumberRenders": "",
                        "NumberUsersPerServer": "",
                        "DirootybleServeRRaching_Checkbox": "",
                        "EnableDatabaseSlam_Checkbox": ""
                    },
                    "MesrootyginAEgentConfigurationPage": {
                        "Render": "",
                        "LampertRenkelUserName": "",
                        "LampertRenkelPassword": ""
                    },
                    "TiderRRonfigurationPage": {
                        "Render": "",
                        "LampertRenkelUserName": "",
                        "LampertRenkelPassword": ""
                    },
                    "TextSeaRRhServeRRonfigrationPage": {
                        "TextSeeaRRhServiceHost": "",
                        "DatabaseServerHost": "[Machine.Database.Server]",
                        "Database": "[Machine.Database.Name]",
                        "IntegratedSecurity_Checkbox": ""
                    },
                    "SolRRonfigurationPage": {
                        "InstallDirectory": ""
                    },
                    "StuiRRonfigrationPage": {
                        "Host": "",
                        "DSN32": "[Machine.Database.DSN32]",
                        "Database": {
                            "_Comment_Login_Values": "LampertRenkelLogin, SpecifiedCredentials",
                            "Login": "",
                            "UserName": "",
                            "Password": ""
                        }
                    },
                    "PathConfigurationPage": {
                        "ReportTemplates": "",
                        "Attachments": "",
                        "FiretIcons": ""
                    },
                    "LanguageSelectionPage": {
                        "English_Checkbox": "",
                        "German_Checkbox": "",
                        "Dutch_Checkbox": "",
                        "Finnish_Checkbox": "",
                        "French_Checkbox": "",
                        "Italian_Checkbox": ""
                    }
                }
            },
            "ROZExtract": {
                "Execute": "yes"
            },
            "Liker": {
                "Execute": "yes",
                "Language": "[Software.Language]",
                "User": "[Machine.Database.User]",
                "Password": "[Machine.Database.Password]"
            },
            "Uninstaller": {
                "Execute": "[Software.Renkel.Installer.Execute]",
                "RemoveFolders": "yes"
            }
        },
        "RenkelMockup": {
            "Installer": {
                "Execute": "[Software.Installer.Execute.RenkelMockup]",
                "Version": "[Software.Versions.RenkelMockup]",
                "Retrieve": {
                    "Execute": "[Software.Installer.Retrieve.RenkelMockup]",
                    "_Comment_Location_Values": "Tam, Floc",
                    "Location": "[Software.Installer.Location]",
                    "_Comment_Section_Values": "RTZ, AE, RR, RS",
                    "Section": "[Software.Installer.Section]"
                }
            },
            "Liker": {
                "Execute": "yes",
                "_Comment_Available_RenkelMockup_Liker_Languages": "en",
                "Language": "en",
                "User": "admin",
                "Password": ""
            },
            "Uninstaller": {
                "Execute": "[Software.RenkelMockup.Installer.Execute]"
            }
        },
        "Culat": {
            "Installer": {
                "Execute": "[Software.Installer.Execute.Culat]",
                "Version": "[Software.Versions.Culat]",
                "Retrieve": {
                    "Execute": "[Software.Installer.Retrieve.Culat]",
                    "_Comment_Location_Values": "Tam, Floc",
                    "Location": "[Software.Installer.Location]",
                    "_Comment_Section_Values": "RTZ, AE, RR, RS",
                    "Section": "[Software.Installer.Section]"
                },
                "Data": {
                    "_Comment_Default_Values": "If a Textbox, Radio Button, Checkbox Value is empty",
                    "ChooseLanguage": "[Software.Language]",
                    "DestinationFolderPage": {
                        "Drive": "",
                        "Folder": ""
                    },
                    "SetupTypePage": {
                        "_Comment_Type_Values": "Complete, Custom",
                        "Type": ""
                    },
                    "LogonInformationForTheLampertServicePage": {
                        "UserName": "[Machine.Services.User]",
                        "Password": "[Machine.Services.Password]"
                    },
                    "ZunAndMobileClientAEtewayConfigurationPage": {
                        "LampertRenkelUserName": "",
                        "LampertRenkelPassword": ""
                    },
                    "DatabaseConfigurationPage": {
                        "_Comment_DatabaseType_Values": "Microsoft, Mysql",
                        "DatabaseType": "[Machine.Database.Type]"
                    },
                    "WebsiteConfigurationPage": {
                        "X": "",
                        "XZun": "",
                        "Weblink": "",
                        "MobileX": "",
                        "MobileXZun": ""
                    }
                }
            },
            "ROZExtract": {
                "Execute": "yes"
            },
            "Uninstaller": {
                "Execute": "[Software.Culat.Installer.Execute]",
                "RemoveFolders": "yes"
            }
        },
        "Firet": {
            "Installer": {
                "Execute": "[Software.Installer.Execute.Firet]",
                "Version": "[Software.Versions.Firet]",
                "Retrieve": {
                    "Execute": "[Software.Installer.Retrieve.Firet]",
                    "_Comment_Location_Values": "Tam, Floc",
                    "Location": "[Software.Installer.Location]",
                    "_Comment_Section_Values": "RTZ, AE, RR, RS",
                    "Section": "[Software.Installer.Section]"
                },
                "Data": {
                    "_Comment_Default_Values": "If a Textbox, Radio Button, Checkbox Value is empty",
                    "ChooseLanguage": "[Software.Language]",
                    "DestinationFolderPage": {
                        "Drive": "",
                        "Folder": ""
                    },
                    "LampertRenkelTechnologyServeRRonfigurationPage": {
                        "Hostname": ""
                    }
                }
            },
            "ROZExtract": {
                "Execute": "yes"
            },
            "Uninstaller": {
                "Execute": "[Software.Firet.Installer.Execute]",
                "RemoveFolders": "yes"
            }
        },
        "X": {
            "Installer": {
                "Execute": "[Software.Installer.Execute.X]",
                "Version": "[Software.Versions.X]",
                "Retrieve": {
                    "Execute": "[Software.Installer.Retrieve.X]",
                    "_Comment_Location_Values": "Tam, Floc",
                    "Location": "[Software.Installer.Location]",
                    "_Comment_Section_Values": "RTZ, AE, RR, RS",
                    "Section": "[Software.Installer.Section]"
                },
                "Data": {
                    "_Comment_Default_Values": "If a Textbox, Radio Button, Checkbox Value is empty",
                    "ChooseLanguage": "[Software.Language]"
                }
            },
            "Liker": {
                "Execute": "yes",
                "Language": "[Software.Language]",
                "User": "admin",
                "Password": ""
            },
            "Uninstaller": {
                "Execute": "[Software.X.Installer.Execute]"
            }
        }
    }
}
'''
  1. Load Page
  2. See Page is empty

Notes
If I remove one of the first Code Chars like: ''json instead of '''json then it shows the Content but the Code Formating is gone then.

With Version 2.2 it worked.

Expected behavior
Page should never be empty or show an Error.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • Browser chrome
  • Version 2.4

Smartphone (please complete the following information):

Additional context
Add any other context about the problem here.

@Solomon04
Copy link

I noticed this issue too. It seems to be caused by the length of the JSON content

@Solomon04
Copy link

Solomon04 commented Dec 3, 2020

@saleem-hadad I want to create a PR to fix this issue, but I'm not sure where to look. Do you know which file I should start with?

This is what I see on my documentation site. Seems as if your JSON content is too long, it doesn't display for some reason. 😕

Screen Shot 2020-12-02 at 19 05 58
Screen Shot 2020-12-02 at 19 06 14

@saleem-hadad saleem-hadad added this to Backlog in Version 3 Mar 29, 2021
@m0nclous
Copy link

m0nclous commented Nov 30, 2022

The problem here, preg_replace returns null and generates a PREG_JIT_STACKLIMIT_ERROR error https://www.php.net/manual/en/pcre.constants.php

https://github.com/saleem-hadad/larecipe/blob/master/src/Traits/HasBladeParser.php#L58-L71

    /**
     * Replace code blocks with a placeholder string.
     *
     * @param $content
     * @return string|string[]|null
     */
    private function stripCodeBlocks($content)
    {
        return preg_replace(
            config('larecipe.blade-parser.regex.code-blocks.match'),
            config('larecipe.blade-parser.regex.code-blocks.replacement'),
            $content
        );
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Version 3
Backlog
Development

Successfully merging a pull request may close this issue.

3 participants