ID:1627200
Jul 14 2014, 1:57 am
|
|||||
| |||||
Can we please get support for tabbing in [dm] blocks? I don't like posting my code and then having tabs converted to 4 spaces. It makes sharing code a lot harder than it needs to be.
|
Jul 14 2014, 4:34 am
|
|
They support tabs.
|
We can accept the tabs, but if you mean having them display with tab characters, I don't see how that could be done without bowing to the whim of the browser. My understanding is that control over spaces per tab in <pre> tags isn't widespread.
|
I found a hack that uses Adobe Flash to make a button that will copy text directly to the clipboard. It seems to work with all current browsers, so it might be a good workaround, or even the only cross-browser workaround that will preserve the actual tab characters.
I guess it just depends on how hard it would be to implement this. |
Really? Whenever I copy code out of a DM block I get the tabs converted to spaces.
That means someone puts a snippet up then I have to use 'advanced find and replace' to replace all 4 spaces to tabs within the dream maker. Are you sure they support tabs? Have you ever taken code out of a block that was posted and it copied the tabs? |
Ah, sorry, I misunderstood. You don't like that they convert tabs to 4 spaces. I thought you didn't like converting your code to 4 spaces in order to post them.
My bad. |
Oh right yeah easy mistake. Yeah that's exactly what I mean. Everyone who has posted or used a snippet already deals with it in their own way but if the conversion could be taken out that would be amazing.
|
Related: Tab in Forums
|
In response to Lummox JR
|
|
Is it not possible to—upon submitting a post—convert all instances of N spaces to the \t character? Perhaps even a specifier could be added to the start of <dm> tags to give the syntax highlighter an idea of what you want:
// Use tabs for indention for the rest of the snippet: |
In response to LordAndrew
|
|
The original post is about the fact that on display, tabs are converted to 4 spaces. It's not that the poster is using 4 spaces and wants the tab character in their place.
The problem is if we don't convert to spaces, the browser controls how many spaces it actually shows--which is 8 for most of them by default. Most browsers allow tab-size to be set (albeit usually with a prefix), except for IE which doesn't support it even in IE11. |
What about an attribute for the <dm> tag such as "tabsize=4"? Would that be a possibility? Is it possible to parse this information so that it changes tab-size appropriately?
example: <dm tabsize="4"> |
In response to Mr_Goober
|
|
Mr_Goober wrote:
What about an attribute for the <dm> tag such as "tabsize=4"? Would that be a possibility? Is it possible to parse this information so that it changes tab-size appropriately? That would only be relevant to the post filter that translates the <dm> tag and its contents into real HTML. It doesn't solve the OP's problem, that he wants the tabs preserves so that copying to the clipboard will leave them intact. |