Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited tags
Link
NickD
  • 33.6k
  • 3
  • 30
  • 47
Bumped by Community user
added 422 characters in body
Source Link
scribe
  • 1.1k
  • 7
  • 17

I am working on a package that makes an API call and gets strings with improperly oriented curly quotes, e. g.,

The word ’syneresis’ comes from Greek roots meaning ’take’ and ’together’.

Is there a clean builtin way (function I could call) to fix issues like this?

Edit: Example:

(fix-quotes "’syneresis’ comes from Greek roots meaning ’take’")
    => ‘syneresis’ comes from Greek roots meaning ‘take’

quotes

Which looks like this:

‘syneresis’ comes from Greek roots meaning ‘take’

See here for curly quotes reference. Note that in the original string we only had ending quotes.

Edit: Picture

Here is a picture that may make it more clear,

enter image description here

The top text has the improperly oriented quote mark because it is the right quote (punctuation that denotes the end of a quotation). We need the properly oriented quote mark which is the left quote (punctuation that denotes the start of a quotation). Imagine <,> are quote marks, the input is >take> and we want <take>.

I am working on a package that makes an API call and gets strings with improperly oriented curly quotes, e. g.,

The word ’syneresis’ comes from Greek roots meaning ’take’ and ’together’.

Is there a clean builtin way (function I could call) to fix issues like this?

Edit: Example:

(fix-quotes "’syneresis’ comes from Greek roots meaning ’take’")
    => ‘syneresis’ comes from Greek roots meaning ‘take’

quotes

Which looks like this:

‘syneresis’ comes from Greek roots meaning ‘take’

See here for curly quotes reference. Note that in the original string we only had ending quotes.

I am working on a package that makes an API call and gets strings with improperly oriented curly quotes, e. g.,

The word ’syneresis’ comes from Greek roots meaning ’take’ and ’together’.

Is there a clean builtin way (function I could call) to fix issues like this?

Edit: Example

(fix-quotes "’syneresis’ comes from Greek roots meaning ’take’")
    => ‘syneresis’ comes from Greek roots meaning ‘take’

Which looks like this:

‘syneresis’ comes from Greek roots meaning ‘take’

See here for curly quotes reference. Note that in the original string we only had ending quotes.

Edit: Picture

Here is a picture that may make it more clear,

enter image description here

The top text has the improperly oriented quote mark because it is the right quote (punctuation that denotes the end of a quotation). We need the properly oriented quote mark which is the left quote (punctuation that denotes the start of a quotation). Imagine <,> are quote marks, the input is >take> and we want <take>.

Add screenshot to show the almost-imperceptible difference
Source Link
phils
  • 53k
  • 3
  • 84
  • 127

I am working on a package that makes an API call and gets strings with improperly oriented curly quotes, e. g.,

The word ’syneresis’ comes from Greek roots meaning ’take’ and ’together’.

Is there a clean builtin way (function I could call) to fix issues like this?

Edit: Example:

(fix-quotes "’syneresis’ comes from Greek roots meaning ’take’")
    => ‘syneresis’ comes from Greek roots meaning ‘take’

quotes

Which looks like this:

‘syneresis’ comes from Greek roots meaning ‘take’

See here for curly quotes reference. Note that in the original string we only had ending quotes.

I am working on a package that makes an API call and gets strings with improperly oriented curly quotes, e. g.,

The word ’syneresis’ comes from Greek roots meaning ’take’ and ’together’.

Is there a clean builtin way (function I could call) to fix issues like this?

Edit: Example:

(fix-quotes "’syneresis’ comes from Greek roots meaning ’take’")
    => ‘syneresis’ comes from Greek roots meaning ‘take’

Which looks like this:

‘syneresis’ comes from Greek roots meaning ‘take’

See here for curly quotes reference. Note that in the original string we only had ending quotes.

I am working on a package that makes an API call and gets strings with improperly oriented curly quotes, e. g.,

The word ’syneresis’ comes from Greek roots meaning ’take’ and ’together’.

Is there a clean builtin way (function I could call) to fix issues like this?

Edit: Example:

(fix-quotes "’syneresis’ comes from Greek roots meaning ’take’")
    => ‘syneresis’ comes from Greek roots meaning ‘take’

quotes

Which looks like this:

‘syneresis’ comes from Greek roots meaning ‘take’

See here for curly quotes reference. Note that in the original string we only had ending quotes.

added 407 characters in body
Source Link
scribe
  • 1.1k
  • 7
  • 17
Loading
Source Link
scribe
  • 1.1k
  • 7
  • 17
Loading