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

* 2. does not produce <li>2.</li> #2337

Closed
3 tasks done
jpcaveiro opened this issue Apr 16, 2024 · 1 comment
Closed
3 tasks done

* 2. does not produce <li>2.</li> #2337

jpcaveiro opened this issue Apr 16, 2024 · 1 comment

Comments

@jpcaveiro
Copy link


By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.org/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('knitr'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/knitr').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

This does **not** produce <li>2.</li>:

* 2.  
* 3.
* 4.
* 5.



This does produce <li>2.123</li>:

* 2.123
* 3.3
* 4.34564523
* 5.

This does produce <li>6</li>:

* 6
* 7
* 8
* 9
> xfun::session_info('knitr')
R version 4.3.3 (2024-02-29 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22621), RStudio 2023.12.1.402

Locale:
  LC_COLLATE=Portuguese_Portugal.utf8  LC_CTYPE=C                          
  LC_MONETARY=Portuguese_Portugal.utf8 LC_NUMERIC=C                        
  LC_TIME=Portuguese_Portugal.utf8    
system code page: 65001

Package version:
  evaluate_0.23   graphics_4.3.3  grDevices_4.3.3 highr_0.10      knitr_1.45     
  methods_4.3.3   stats_4.3.3     tools_4.3.3     utils_4.3.3     xfun_0.43      
  yaml_2.3.8  
@atusy
Copy link
Collaborator

atusy commented Apr 16, 2024

This behavior comes from Pandoc which parses * 2. as a bullet list containing an ordered list.

» echo '* 2.' | pandoc -t native                                                                                                                                                
[ BulletList
    [ [ OrderedList ( 2 , Decimal , Period ) [ [] ] ] ]
]

You need backslash escape to avoid the behavior.

» echo '* 2\.' | pandoc -t native                                                                                                                                                
[ BulletList
    [ [ OrderedList ( 2 , Decimal , Period ) [ [] ] ] ]
]

Just for the next time you face unexpected behaviors with markdown syntax, I would recommend inspect Pandoc's behavior.
knitr only deals with chunks and inline chunks, not with markdown syntaxes in general.

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