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

word wrap settings for description text for scenario lead to undesirable effects #300

Closed
cstrong opened this issue Mar 6, 2016 · 4 comments
Labels

Comments

@cstrong
Copy link

cstrong commented Mar 6, 2016

As of today, the scenario description text gets wrapped in a <pre><code></code></pre> block with word wrap settings that are lead to the following undesirable output:

I want to be able to perform arithmetic o
n the calculator

See how the word "on" is broken in half on two lines. Not good.

We have worked around the problem by hacking bootstrap.min.css to change the word-wrap settings for <pre>
We changed line 165 of bootstrap.min.css to use word-break:normal;word-wrap:normal as per below:

pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:normal;word-wrap:normal;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}pre.prettyprint{margin-bottom:20px;}

Obviously this is not a good long-term solution. Twitter bootstrap is used by zillions of web sites, and they won't change the behavior of <pre> for our obscure use case.
This makes me think that <pre> is not the correct tag to use for this text.

I recommend that a <p> tag be used instead (since it will word wrap correctly). The <p> tag can be styled to use courier font if the same look and feel needs to be maintained.

@dirkrombauts
Copy link
Member

Hi,

With regard to the current behaviour (scroll down for future behaviour):

A quick question: is your scenario description aligned flush against the left side, or is it indented?

So for example - do you have a

Description like this

or a

Description like that?

Since version 2, the parsing is more strict and indented descriptions will be interpreted as a code block.

With regard to the future behaviour:

I would like to have a step before the markdown parsing that strips away leading blanks if every line in the description either has the same amount of leading blanks or is empty. I would welcome Pull Requests :-)

@cstrong
Copy link
Author

cstrong commented Mar 7, 2016

Our description looks like the second one (courier font) just like in your example here:
http://www.picklesdoc.com/Output/DHtml/Index.html#Features\Arithmetic.feature

@dirkrombauts
Copy link
Member

Thanks, I fixed the alignment of the Arithmetic feature and now it looks like the first one. That doesn't solve your problem but it proves my theory. I will create a work item to describe the changes I mentioned to the markdown parser.

@dirkrombauts
Copy link
Member

I created issue #302 to address this problem.

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

No branches or pull requests

2 participants