Back-tick issue in Swift and in the forums Markdown

solved

(Adrian Zubarev) #1

Sometimes I write answers in the forum using my iPad and I noticed that back-ticks from the iOS keyboard don't produce the expected result. Basically they don't render.

  • using macOS back-ticks
  • ˋusing iOS back-ticksˋ

I tried them out in Swift as well and found that the compiler also does not handle that particular back-tick as the normal one.

let a = "`" // macOS back-tick - German Keyboard Layout

// This back-tick is also differently rendered, but it's
// hard to notice on the first glance.
let b = "ˋ" // iOS back-tick - German Keyboard Layout

let c_a = Character(a)
let c_b = Character(b)

// prints "false false [96] [715]"
print(
  a == b,
  c_a == c_b,
  c_a.unicodeScalars.map { $0.value },
  c_b.unicodeScalars.map { $0.value }
)

struct T {
  // macOS back-tick - German Keyboard Layout
  func `is`(test1: Int) {}

  // iPad / iOS back-tick - German Keyboard Layout
  func ˋisˋ(test2: Int) {}
}

let t = T()
t.is(test1: 42)
t.ˋisˋ(test2: 42) // Does not allow to omit these type of back-ticks
  • Should Swift support this back-tick as well?
    • An issue that I see is that if I would import code written in Swift Playgrounds from iOS it may contain wrong / unsupported back-tick's.
  • I guess there is not much we can do about the forums markdown, or can we? cc. @forum_admins

(Xiaodi Wu) #2

That isn’t a backtick. That’s a modifier grave accent.


(Adrian Zubarev) #3

Hi @xwu thank you for the hint, I didn't know. It looked the same to me and it was in a convenient place on the keyboard. I looked up all alternative keys and finally found the correct back-tick. It's really inconveniently placed on the German keyboard layout, but at least I know where it is now.

This thread can be considered as solved then.