Skip to main content
edited tags
Link
Active reading.
Source Link
Peter Mortensen
  • 31.6k
  • 4
  • 22
  • 14

support Support the Swift language with syntax highlighting

The Swift language isn't listed in the complete list of every identifier that you can use in the language hint for syntax highlighting.

Currently, the tag is configured for default language hint (so using <!-- language: swift --> is the same as <!-- language: default -->). But that's not enough for Swift, as it won't colorize correctly keywords correctly like:

func
guard
protocol
extension
fileprivate
open
mutating
inout
fallthrough
typealias
willSet
didSet
subscript
Self
convenience
required
init
deinit
unowned
lazy
defer
optional
associatedtype
prefix
infix

It will also wrongly recognize some keywords which aren't existing in Swift:

union
select

I understand that internally, Stack Exchange uses Google Code Prettify, but I also noticed that the Swift extension for Prettify does exist. Sadly, it doesn't seem installed yet on Stack Overflow.

support Swift language with syntax highlighting

The Swift language isn't listed in the complete list of every identifier that you can use in the language hint for syntax highlighting.

Currently, the tag is configured for default language hint (so using <!-- language: swift --> is same as <!-- language: default -->). But that's not enough for Swift, as it won't colorize correctly keywords like:

func
guard
protocol
extension
fileprivate
open
mutating
inout
fallthrough
typealias
willSet
didSet
subscript
Self
convenience
required
init
deinit
unowned
lazy
defer
optional
associatedtype
prefix
infix

It will also wrongly recognize some keywords which aren't existing in Swift:

union
select

I understand that internally, Stack Exchange uses Google Code Prettify, but I also noticed that the Swift extension for Prettify does exist. Sadly, it doesn't seem installed yet on Stack Overflow.

Support the Swift language with syntax highlighting

The Swift language isn't listed in the complete list of every identifier that you can use in the language hint for syntax highlighting.

Currently, the tag is configured for default language hint (so using <!-- language: swift --> is the same as <!-- language: default -->). But that's not enough for Swift, as it won't colorize keywords correctly like:

func
guard
protocol
extension
fileprivate
open
mutating
inout
fallthrough
typealias
willSet
didSet
subscript
Self
convenience
required
init
deinit
unowned
lazy
defer
optional
associatedtype
prefix
infix

It will also wrongly recognize some keywords which aren't existing in Swift:

union
select

I understand that internally, Stack Exchange uses Google Code Prettify, but I also noticed that the Swift extension for Prettify does exist. Sadly, it doesn't seem installed yet on Stack Overflow.

Source Link
Cœur
  • 38.6k
  • 9
  • 79
  • 124

support Swift language with syntax highlighting

The Swift language isn't listed in the complete list of every identifier that you can use in the language hint for syntax highlighting.

Currently, the tag is configured for default language hint (so using <!-- language: swift --> is same as <!-- language: default -->). But that's not enough for Swift, as it won't colorize correctly keywords like:

func
guard
protocol
extension
fileprivate
open
mutating
inout
fallthrough
typealias
willSet
didSet
subscript
Self
convenience
required
init
deinit
unowned
lazy
defer
optional
associatedtype
prefix
infix

It will also wrongly recognize some keywords which aren't existing in Swift:

union
select

I understand that internally, Stack Exchange uses Google Code Prettify, but I also noticed that the Swift extension for Prettify does exist. Sadly, it doesn't seem installed yet on Stack Overflow.