ASM Tags and Tabs

Discussion in 'Suggestions and Feedback Archive' started by Selbi, Mar 7, 2015.

Thread Status:
Not open for further replies.
  1. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    After I wrote this post I've noticed that all the tabs in the [asm] tags were completely removed, only leaving two regular spaces behind. When I saw the amount of posts that had the same problem I always assumed it was people incapable of properly pasting code, but as it turns out, that has nothing to do with it.

    Adding =auto:0 to a code box makes sure the text gets preserved as originally written. Such a feature doesn't exist with the ASM tags, though it would be really helpful. Can this be added (or even entirely made the default option, since there really isn't any reason to have auto-formatting on code snippets)?
     
  2. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    While we're on the subject of "code" tags, could we finally remove the syntax highlighting? We've already established that the "asm" tags will be used for "asm" syntax highlighting. Other code that does not fall under the assembly syntax highlight scheme can use the "code" tag, unfortunately, it's resorted to syntax highlighting of the assembly kind, and that leads to confusion when attempting to explain data, and having colours pop in and separate data where it isn't separated.

    I believe I mentioned this before, but clearly got ignored.
     
  3. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    I agree with both of you. The asm tags have been broken for an eternity and a half and quite frankly I don't see why nobody's fixed them yet.

    *shrugs*
     
  4. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    A bit harsh there to suggest you were just ignored. I had a look through the suggestions forum and the only other mention of the topic I could find was Jan 2014, and was not posted in by yourself. If your post was made as part of another topic where this problem became evident then it is possible that the staff may have overlooked the post or simply not noticed it at all. That's what this subforum is for after all =P

    Quite frankly, I don't like your attitude here. If they were broken and you knew about it, where was your report to bring it to our attention? As for why they've not been fixed, possibly an admin forgot way back when it was reported and it was never mentioned since. Believe it or not, some of us have very fulfilling lives away from here and aren't around to monitor every single post to ensure they are entirely bug free. Mistakes are made, things get missed, shit happens. A little reminder is all it takes to refresh the memory.
     
  5. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    My goodness, you are right!

    I've posted a few complaints regarding the "asm" and "code" tags in the staff lounge in the past, such as; the apostrophe tampering with the colour highlighting, and tabs being converted into spaces, and the whole "code" colour general thing appears to not be one of them! I do apologies.

    Having said that though, the apostrophe issue is still around (I understand why though), and the tab to space issue is also still around (as Selbi has just pointed out), if I had mentioned my issue, I'm not convinced it would have been fixed. This is why my post came across as rather aggressive initially. I once again apologise, but I'm afraid the issues are taking their toll. The highlighting of the "code" tags seems far too specific to assembly, I could be wrong, but was it us that put the highlighting scheme in in the first place?
     
  6. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Reminder.
     
  7. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    Don't worry, we haven't forgotten already. I spoke to Ordos about it over the weekend and we're looking into it. Just to help us, can you list every problem with the tags in this topic? I know people have had different issues and they seem to be dotted around different threads. Might as well look at all the issues at once. I was too busy to look over it at the weekend but hopefully this weekend I should have a lot more time to look into it.
     
  8. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Well, there appears to be an automatic white-space trimmer embedded in IPB. When directly pasting code in the reply box while "BBCode Mode" is enabled, everything's fine, but as soon as I paste any code in the Rich Text Box, every tab gets replaced with exactly 4 spaces (this even ignores the =auto:0 feature of the default code box).

    When clicking on preview, editing a post, or even when pasting the code in the plain text box and then switching to the rich one, all tabs at the beginning and an end of a line get completely deleted while those in between get replaced with a single space (my main complaint).



    Code:move.b ($FFFFF603).w,d0 ; get controls

    andi.b #$70,d0 ; is ABC pressed?

    beq.s + ; if not, branch

    move.w #$B00,d1 ; set d1 to $B00

    +

    rts ; return



    Right now the only way to preserve a properly formatted code is to go enable plain BBCode Mode and paste it in a code=auto:0 box:

    Code:
    Code:
    		move.b	($FFFFF603).w,d0	; get controls
    		andi.b	#$70,d0			; is ABC pressed?
    		beq.s	+			; if not, branch
    		move.w	#$B00,d1		; set d1 to $B00
    +
    		rts				; return
    So yeah, the built-in white-space trimmer of IPB is the cause of this, as it doesn't ignore the "ASM" tag. Adding an exception like the code boxes have should already do the job.
     
    Last edited by a moderator: Mar 18, 2015
  9. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    Ok so I've looked into this and found what I believe to be a temporary workaround for the problem you're having. I've been trying to find a way to alter the rendering of the RTE but I'm not having much luck at the moment. As a temporary fix (at least it seems to work in the preview), when pasting code between the ASM tags, use the Paste as Plain Text option and insert your code that way. This appears to keep all formatting intact and will hopefully be a good solution until we can find a way of making it permanent, if such an option exists. The RTE rendering in IPB3 is complete shit, but it is supposed to be completely revised for IPB4 which is due to land sometime soon, so with any luck this problem will be fixed one way or the other.
     
  10. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    It looks fine in the paste as plain text window, but upon pressing OK it gets stripped again and also adds empty lines which are not there in the original code. Though, to give it some credit, instead of completely deleting the tabs at the beginning, it gets replaced with spaces.



    Code:
      move.b ($FFFFF603).w,d0 ; get controls

      andi.b #$70,d0   ; is ABC pressed?

      beq.s +   ; if not, branch

      move.w #$B00,d1  ; set d1 to $B00

    +

      rts    ; return
     
  11. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    The problem I'm having at the moment with these issues is that they're all hard coded into IPB3 and there's no documentation online on which files need to be altered in order to make this shit work as it should. This is something that could take a while, so please bear with us. We may have a solution for the syntax highlighting in CODE tags. It turns out IPB3 uses the third party javascript file Google Prettify (fucking retarded name) for the syntax highlighting and I have found the related files. We'll be running some tests shortly to see if we have eliminated that problem, so at least that's one less thing on the list. I'll keep you updated on how this goes.

    EDIT: Just tried a generic bit of code, and the tabs being replaced with spaces makes it look a bit better, but I see your point. I'll keep trying and see if I can find a way to get this working.



    Label:
      move.w 2(a1),d2       ;Comment

      sub.w $C(a0),d2         ;Comment

      bpl.s Label2               ;Comment

      neg.w d2             ;Comment
     
    Last edited by a moderator: Mar 18, 2015
  12. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    Just to update, the syntax highlighting in code boxes appears to have been taken care of. Force a browser re-cache for it to take effect. As for the other issues, we're still working on finding solutions for them.
     
Thread Status:
Not open for further replies.