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

Too many new lines #14

Closed
andresriancho opened this issue Mar 30, 2015 · 6 comments
Closed

Too many new lines #14

andresriancho opened this issue Mar 30, 2015 · 6 comments
Assignees

Comments

@andresriancho
Copy link
Contributor

The migration tool did a great job, but it kept some new lines we don't need. Also, when we '\n'.join(description) we add more new lines resulting on markdown that's 100% valid but hard to read for humans:

too-many-new-lines

It seems that we need to convert the json files again, finding all simple new lines (\n) and removing them. The "double new lines" (\n\n) should remain untouched.

@m0sth8
Copy link
Contributor

m0sth8 commented Mar 30, 2015

According to database design the right way to join multilines is '
'.join(description)

On Monday, March 30, 2015, Andres Riancho [email protected] wrote:

The migration tool did a great job, but it kept some new lines we don't
need. Also, when we '\n'.join(description) we add more new lines
resulting on markdown that's 100% valid but hard to read for humans:

[image: too-many-new-lines]
https://cloud.githubusercontent.com/assets/865200/6899746/b9ff308a-d6d8-11e4-903a-497f176d40d8.png

It seems that we need to convert the json files again, finding all simple
new lines (\n) and removing them. The "double new lines" (\n\n) should
remain untouched.


Reply to this email directly or view it on GitHub
#14.

@andresriancho
Copy link
Contributor Author

Not sure what you intended to write there, or the email did something strange?

@m0sth8
Copy link
Contributor

m0sth8 commented Mar 30, 2015

Sorry, I mean than you have to join strings with empty space like described in #5

"So, the parser should check if the description and solution fields are strings or arrays. If they are arrays, the contents of the array should be joined using an empty space"

@andresriancho
Copy link
Contributor Author

See Join multiline strings with '' , ' ' or '\n'? #16

After reading that, read https://github.com/vulndb/data/blob/master/db/45-sql-injection.json , pay special attention to https://github.com/vulndb/data/blob/master/db/45-sql-injection.json#L7 . In the python-sdk I'm using \n to join the strings (because I was unsure about #16), so the result for the first lines is:

  "description": [
    "Due to the requirement for dynamic content of today's web", 
    "applications, many\nrely on a database backend to store data that will", ...

Result text: Due to the requirement for dynamic content of today's web\napplications, many\nrely on a database backend to store data that will

Printed text:

Due to the requirement for dynamic content of today's web
applications, many
rely on a database backend to store data that will

Rendered markdown as html:

<p>Due to the requirement for dynamic content of today's web applications, many rely on a database backend to store data that will</p>

Which is similar to what's shown in the screenshot. So the \n after "many" was inherited from Arachni and is not really needed (IMHO), since it only adds new lines to the text that markdown will ignore anyways

It doesn't matter if we decide to join with \n or ' ', but those new lines (IMHO) don't make any sense

Of course the double new lines we imported from arachni do make sense, since they are new paragraphs for markdown

@m0sth8
Copy link
Contributor

m0sth8 commented Mar 30, 2015

Oh, I see =) that makes sense.

@andresriancho
Copy link
Contributor Author

Your opinion on #16 ?

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

No branches or pull requests

2 participants