rain13 Posted September 28, 2014 Share Posted September 28, 2014 Hello. I have problem with syntax highlighter - it doesn't break lines. If your browser window is too narrow the lines will go out of window and cause horizontal scrollbars to appear which I don't want.Here's my problematic post:http://autoit.net.ee/pub/?id=152 (pay attention to 39th line)I have no ideas what to try next. I want to break lines but none of what I've tried so far works. .syntaxhighlighter table td.code .line { white-space: pre-wrap !important; word-wrap: break-word !important; white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.5+ */} Link to comment Share on other sites More sharing options...
dsonesuk Posted September 28, 2014 Share Posted September 28, 2014 try inline-block .au3 { display: inline-block; } Link to comment Share on other sites More sharing options...
rain13 Posted September 28, 2014 Author Share Posted September 28, 2014 Thanks. It worked but when I googled how to make syntaxhighlighter to wrap lines I found instructions that told me to .syntaxhighlighter table td.code .line { white-space: pre-wrap !important; word-wrap: break-word !important;} Why didn't this work?Now it breaks line numbering and I tried javascript suggested here, but it didn't work.http://stackoverflow.com/questions/6286733/automatic-line-break-in-js-syntaxhighlighter Link to comment Share on other sites More sharing options...
dsonesuk Posted September 28, 2014 Share Posted September 28, 2014 Maybe because its for actual break in text and not code tag with each individual parts of text that make up code, that is why display: inline-block; works because it makes the code tag act as text would; Link to comment Share on other sites More sharing options...
dsonesuk Posted September 29, 2014 Share Posted September 29, 2014 For the line numbering to work correctly it should wrap round the code tags as well, so it will expand with content and push next line number down. Link to comment Share on other sites More sharing options...
rain13 Posted September 29, 2014 Author Share Posted September 29, 2014 Didn't understand it.Doesn't .au3 { display: inline-block; } already wrap round the code tags?How shall I do that? Link to comment Share on other sites More sharing options...
Tosey Posted September 29, 2014 Share Posted September 29, 2014 No no no! I think you should try using if others don't work: selector { wb } fill the rest. yourself Link to comment Share on other sites More sharing options...
dsonesuk Posted September 29, 2014 Share Posted September 29, 2014 You want <div class="line number39 index38 alt2">39</div> to expand when code stacks as it is still line number 39, so you need something similar to <div class="line number39 index38 alt2">39<div class="line number39 index38 alt2"><code class="au3 spaces"> </code><code class="au3 functions">FileCopy</code><code class="au3 plain">(</code><code class="au3 variable">$ssrc</code><code class="au3 plain">& </code><code class="au3 string">""</code> <code class="au3 plain">& </code><code class="au3 functions">StringTrimRight</code><code class="au3 plain">(</code><code class="au3 variable">$arr</code><code class="au3 plain">[</code><code class="au3 variable">$i</code><code class="au3 plain">],4) & </code><code class="au3 string">".nef"</code><code class="au3 plain">,</code><code class="au3 variable">$sdst</code><code class="au3 plain">& </code><code class="au3 string">""</code> <code class="au3 plain">&</code><code class="au3 functions">StringTrimRight</code><code class="au3 plain">(</code><code class="au3 variable">$arr</code><code class="au3 plain">[</code><code class="au3 variable">$i</code><code class="au3 plain">],4) & </code><code class="au3 string">".nef"</code><code class="au3 plain">,8)</code></div></div> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now