Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening new file converts apostrophe to hex code #64

Closed
junder873 opened this issue Mar 3, 2021 · 1 comment
Closed

Opening new file converts apostrophe to hex code #64

junder873 opened this issue Mar 3, 2021 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@junder873
Copy link

When I import a new citation, I have a template to import various elements, specifically:

---
title: {{title}}
alias:
- 
authors: {{authorString}}
year: {{year}}
---

# Abstract

{{abstract}}

If any of those elements contain an apostrophe ('), then it is converted to the hex code ('). When displayed in the preview, these are correct, but it makes reading the markdown more difficult.

For example, the BibTex:

@ARTICLE{Obrien1988-im,
  title     = "Analysts' forecasts as earnings expectations",
  author    = "O'brien, Patricia C",
  abstract  = "I examine three composite analyst forecast of earnings per share
               as proxies for expected earnings. The most current forecast
               weakly dominates the mean and median forecasts in accuracy. This
               is evidence that forecast dates are more relevant for
               determining accuracy than individual error. Consistent with
               previous research, I find analysts more accurate than
               time-series models. However prior knowledge of forecast errors
               from a quarterly autoregressive model predicts excess stock
               returns better than prior knowledge of analysts' errors. This is
               inconsistent with previous research, and is anomalous given
               analysts' greater accuracy.",
  journal   = "Journal of Accounting and Economics",
  publisher = "Elsevier",
  volume    =  10,
  number    =  1,
  pages     = "53--83",
  month     =  jan,
  year      =  1988,
  url       = "https://www.sciencedirect.com/science/article/pii/0165410188900237",
  file      = "All Papers/O/O'brien 1988 - Analysts' forecasts as earnings expectations.pdf",
  issn      = "0165-4101",
  doi       = "10.1016/0165-4101(88)90023-7"
}

creates the following Markdown:

---
title: Analysts' forecasts as earnings expectations
alias:
- 
authors: Patricia C O'brien
year: 1988
---

# Abstract

I examine three composite analyst forecast of earnings per share as proxies for expected earnings. The most current forecast weakly dominates the mean and median forecasts in accuracy. This is evidence that forecast dates are more relevant for determining accuracy than individual error. Consistent with previous research, I find analysts more accurate than time-series models. However prior knowledge of forecast errors from a quarterly autoregressive model predicts excess stock returns better than prior knowledge of analysts' errors. This is inconsistent with previous research, and is anomalous given analysts' greater accuracy.

I think this is due to how JavaScript handles apostrophes but would appreciate any fix.

@hans hans added the bug Something isn't working label Mar 4, 2021
@hans hans added this to the 0.4.2 milestone Mar 4, 2021
@hans
Copy link
Owner

hans commented Mar 4, 2021

Hmm, I think this counts as a bug -- I can't imagine that we should be escaping everything so aggressively.
It's an easy fix & will be included in the next release.

In the short term -- you can use three curly braces (e.g. {{{title}}}) to force the template variable to render without escaping.

hans added a commit that referenced this issue Mar 4, 2021
@hans hans closed this as completed Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants