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

Table misalignment when there is a value with an ampersand #82

Open
valentas-kurauskas opened this issue Feb 21, 2017 · 1 comment
Open

Comments

@valentas-kurauskas
Copy link

(Originally posted in IRkernel/IRkernel#447.)

With R backend data.frame(letter=c("A", "B&C", "D"), number=c(1000,2,30))

Displays something like this:

letter value
A 1000
A&B     2
C 30

The misaligned cell in html appears as <span style="white-space:pre-wrap"> 2</span>

@flying-sheep
Copy link
Member

flying-sheep commented Feb 21, 2017

OK, so the pre-wrap gets introduced by this function

all matrixes/data.frames go through repr_matrix_generic

the first thing done is ellip_limit_arr(x), which introduces those spaces:

> repr:::ellip_limit_arr(data.frame(letter=c("A", "B&C", "D"), number=c(1000,2,30)))
  letter number
1 "A  "  "1000"
2 "B&C"  "   2"
3 "D  "  "  30"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants