lib: Do not take string context into account

Close #2883.