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

Duplicating HTML tags for FSX and IPYNB output. #695

Closed
DavideGCosta opened this issue Jul 29, 2021 · 4 comments · Fixed by #697
Closed

Duplicating HTML tags for FSX and IPYNB output. #695

DavideGCosta opened this issue Jul 29, 2021 · 4 comments · Fixed by #697

Comments

@DavideGCosta
Copy link

I was trying to add HTML tags through markdown. The HTML output works fine, but the IPYNB and the FSX output duplicates the open tag. I may be missing something here but I think that this example should not duplicate the open tag for the .ipynb and .fsx output.

Input:

(**
 
<p> test
</p>
 
*)
.fsx and .ipynb output:
(**
<p> test
<p> test
</p>
*)
@DavideGCosta
Copy link
Author

Also, you can see how the HMTL output looks:

<div class="container" id="fsdocs-content">
            <p> test
</p>
 
        </div>

It seems to be working fine, as markdown normally is supposed to allow embedded HTML to be passed through unchanged.
But, in the .fsx and .ipynb output, as stated in the issue, there is a duplication of the open tag.

@dsyme
Copy link
Contributor

dsyme commented Jul 29, 2021

Yes that looks like a bug

@dsyme
Copy link
Contributor

dsyme commented Jul 29, 2021

One a quick glance over the code I think this duplicates the firstLine:

https://github.com/fsprojects/FSharp.Formatting/blob/master/src/FSharp.Formatting.Markdown/MarkdownParser.fs#L701

Might be correct if this

  | ((first, _n) as takenLine) :: TakeParagraphLines(html, rest) when first.StartsWith("<") ->

though it's written a bit inefficiently

dsyme pushed a commit to dsyme/FSharp.Formatting that referenced this issue Jul 29, 2021
@dsyme dsyme mentioned this issue Jul 29, 2021
dsyme added a commit that referenced this issue Jul 29, 2021
* fix script links in nested directories

* fix #695

* fix

* fix

* fix

Co-authored-by: Don Syme <donsyme@fastmail.com>
@dsyme
Copy link
Contributor

dsyme commented Jul 29, 2021

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

Successfully merging a pull request may close this issue.

2 participants