日記

Wordpressの投稿でSyntaxHighlighterを使用するとhtmlエスケープ文字が崩れる問題

1 Mins read

WordPress5.2.1
SyntaxHighlighterプラグイン3.5.0

SyntaxHighlighterなどハイライトするようにタグで囲んでソースを貼り付けるとhtmlエスケープ文字(大なり小なりのタグなど。。。)が正しく表示されない

WordPress投稿画面のテキストボックスからフォーカスが離れるイベントで文字列をエンコードしているようなのだが、この処理でおかしくなっているように思う

取り急ぎ左上にある取り消しアイコンを一度押下するとエンコード前に戻るので、その後に公開すると正しく表示される

※公開ボタンを押下した際にもエンコード処理が走っているから戻っても大丈夫
投稿テキストボックスにフォーカスを当てないこと!

 

20190829追記

Classic Editor

を使えば解決!

 

Read more
iOSSwiftXcode

iOS Xcode Swift 4.2 Storyboard上にあるViewControllerをプログラムから呼び出し

1 Mins read

Mac 10.14.5
Xcode 10.2.1
Swift 4.2

Storyboard上にあるViewControllerをプログラムから呼び出し方法
サンプルはMain.storyboardを対象としているので、あらかじめ設定の
「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