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

Bug in "Parse contributors" #3

Closed
pfefferle opened this issue Jan 7, 2014 · 2 comments
Closed

Bug in "Parse contributors" #3

pfefferle opened this issue Jan 7, 2014 · 2 comments

Comments

@pfefferle
Copy link

There is a bug in the "Parse contributors" code...

I have a code block in my readme

header('Content-Type: application/xrd+xml; charset=' . get_bloginfo('charset'), true);

and the result is:

** header('Content-Type:** application/xrd+xml; charset=' . get_bloginfo('charset'), true);

@marcochiesi
Copy link
Contributor

I noticed this bug too. It occurs every time a text line contains a colon ":" character. The code which performs this text replacement should be executed only for plugin header section and not in the whole document.

Here's a quick fix: in wp_readme_to_markdow.js replace the line

        readme = readme.replace( new RegExp("^([^:\r\n*]{1}[^:\r\n#\\]\\[]+): (.+)","gim"),"**$1:** $2  ");

with the following snippet

        if ( header_match && header_match.length >= 1 ) {
            var header_search = header_match[1];
            var header_replace = header_search.replace( new RegExp("^([^:\r\n*]{1}[^:\r\n#\\]\\[]+): (.+)","gim"),"**$1:** $2  ");
            readme = readme.replace( header_search, header_replace );
        }

marcochiesi pushed a commit to marcochiesi/wp-readme-to-markdown that referenced this issue Oct 6, 2014
stephenharris pushed a commit that referenced this issue Aug 26, 2015
… if no section is found. Fixes unit tests: colons in main body of readme should not be treated as readme tags. Ref #3
@stephenharris
Copy link
Owner

Thanks @marcochiesi I've made some changes to your original PR, but this should be fixed now. I'll be publishing a new release shortly.

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

No branches or pull requests

3 participants