Diary

SyntaxHighlighter in WordPress Posts Causes HTML Escape Character Display Issues

1 Mins read

WordPress 5.2.1
SyntaxHighlighter plugin 3.5.0

When pasting source code wrapped in SyntaxHighlighter tags, HTML escape characters (greater than/less than signs, etc.) are not displayed correctly.

It appears the WordPress post editor is encoding strings when focus leaves the text box, and this process is causing the problem.

For now, clicking the undo icon in the upper left once reverts to the pre-encoded state, then publishing after that displays correctly.

※The encoding process also runs when the publish button is clicked, so reverting is safe.
Don’t put focus back on the post text box!

 

Update 20190829

Classic Editor

solves the problem!

 

Read more
Diary

Calling a ViewController from Storyboard Programmatically in iOS Xcode Swift 4.2

1 Mins read

Mac 10.14.5
Xcode 10.2.1
Swift 4.2

How to call a ViewController from Storyboard programmatically
This sample targets Main.storyboard. Make sure to clear the settings beforehand:
“General” > “Deployment Info” > “Main Interface”

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
 
    var window: UIWindow?   //Main Window
 
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
 
        window = UIWindow(frame: UIScreen.main.bounds)
        let storyboard = UIStoryboard(name: "Main", bundle: nil)
        let viewController = storyboard.instantiateInitialViewController()
        window?.rootViewController = viewController
        window?.makeKeyAndVisible()
 
        return true
    }
}
Read more