Down the Rabbit Hole

That text about Russia VAT changes I talked about yesterday is from an email I viewed in Win10 Mail. I cut and paste the content, and figured it was HTML format. It was, and MarkUpDown handled it... interestingly.

Here's the raw HTML:

<span style='font-size:10.5pt;font-family:"Segoe UI",sans-serif;
mso-fareast-font-family:"Times New Roman"; mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA'>Russia will become a
Microsoft remittance country where Microsoft (or its billing service provider)
will collect and remit the VAT on behalf of developers. <strong><span
style='font-family:"Segoe UI",sans-serif'>Effective January 1, 2017, Microsoft
will determine the VAT due, withhold such VAT from your App Proceeds, and remit
directly to the Russia tax authorities</span></strong>. The current VAT rate in
Russia is 18%. </span>

The problem comes when we put that into Markdown block format.

> <span style='font-size:10.5pt;font-family:"Segoe UI",sans-serif;
> mso-fareast-font-family:"Times New Roman"; mso-ansi-language:EN-US;
> mso-fareast-language:EN-US;mso-bidi-language:AR-SA'>Russia will become a
> Microsoft remittance country where Microsoft (or its billing service provider)
> will collect and remit the VAT on behalf of developers. <strong><span
> style='font-family:"Segoe UI",sans-serif'>Effective January 1, 2017, Microsoft
> will determine the VAT due, withhold such VAT from your App Proceeds, and remit
> directly to the Russia tax authorities</span></strong>. The current VAT rate in
> Russia is 18%. </span>

Bonus for anyone who can figure out the issue.

See how that leaves us with an HTML tag that's split over multiple lines?

> <span style='font-size:10.5pt;font-family:"Segoe UI",sans-serif;
> mso-fareast-font-family:"Times New Roman"; mso-ansi-language:EN-US;
> mso-fareast-language:EN-US;mso-bidi-language:AR-SA'>Russia will become a

The Markdown parser handles that quite well, but the > symbols threw off the code I use to align the live preview with the cursor's location as you edit, as it looks like bogus html with all the >'s in the middle. Not great.

So four hours later, I have a fix checked in that seems to be working integrated with MarkUpDown's code (please don't get me started about indie devs' attitudes about (against?) Test Driven Development -- I get that Marco would argue he understands what TDD is, but my guess is he's never actually tried it. That said, I'm not doing it here).

Sure, I also ate and interviewed a programmer in that time, but still... that's a rabbit hole of almost certainly over two hours for a problem only I was likely experiencing.

That's the benefit and danger of being an independent developer. Nobody's going to tell you not to scratch your itch. You're less itchy personally, but that's not always the "best win" for your users.

Labels: , ,