i'm developing mac application contains wkwebview. html in web view contains input field user types code (ruby, in fact). when type quote (") field, automatically turned fancy curly quote (“). since ruby strings use ascii quotes delimiters wrong.
at moment i'm taking user enters , substituting curly quotes ascii quotes before using code, not ideal.
i can't figure out how can disable os x feature. it's possible user in system preferences @ global level, want turn off in app.
is there configuration on wkwebview, or on app bundle itself, or somewhere, can turn off? there html or css option? should using different type of html input field? in whole stack can intervene turn feature off?
when toggle setting in system preferences (keyboard > text > use smart quotes , dashes), sets value key nsautomaticquotesubstitutionenabled in user's global preferences domain. determined comparing output of defaults read -g before after.
you can try setting false app domain in app's start-up see if disables app:
[[nsuserdefaults standarduserdefaults] setbool:no forkey:@"nsautomaticquotesubstitutionenabled"]; try in -applicationwillfinishlaunching: or main().
of course, if works disable throughout app, rather wkwebview.
Comments
Post a Comment