Skip to content

Commit

Permalink
whitespace fix (space after dash before txid link)
Browse files Browse the repository at this point in the history
  • Loading branch information
janoside committed Feb 18, 2021
1 parent 7bf2c7a commit abccbcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion views/includes/block-content.pug
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ div.tab-content
div.card-header.text-monospace
if (tx && tx.txid)
span(title=`Index in Block: #${(txIndex + offset).toLocaleString()}`, data-toggle="tooltip") ##{(txIndex + offset).toLocaleString()}
span –
span –
a(href=("./tx/" + tx.txid + tx_height_param)) #{tx.txid}

if (global.specialTransactions && global.specialTransactions[tx.txid])
Expand Down

4 comments on commit abccbcc

@shesek
Copy link
Contributor

@shesek shesek commented on abccbcc Feb 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally like using = ' ' in a standalone line or sometimes &nbsp; to get an explicit space with pug. Some editors automatically remove trailing line spaces, including the one I'm using, which was driving me crazy (I had to carefully git add -p to avoid adding space changes all over the place) until I found where to turn this off >_< It's also hard to notice that the spaces are there by looking at the code.

There's an overview of some other possible solutions for for adding explicit spaces at pugjs/pug#905 (comment)

@shesek
Copy link
Contributor

@shesek shesek commented on abccbcc Feb 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option not mentioned in that comment is #{' '} at the end of line.

@shesek
Copy link
Contributor

@shesek shesek commented on abccbcc Feb 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you'd like, you could use this to change the trailing spaces into &nbsp;s:

$ find . -name '*.pug' | xargs sed -ir '/ [^ ]/{s/ $/\&nbsp;/}'

@janoside
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks for the background here...good to know. In this case it was just fixing a visual regression. In general, no strong opinions about the issue, but I do appreciate the greater explicitness of both of your solutions and will avoid end-of-line spaces going forward.

Please sign in to comment.