summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibMarkdown
AgeCommit message (Collapse)Author
2023-03-06Everywhere: Remove NonnullOwnPtr.h includesAndreas Kling
2023-03-06Everywhere: Stop using NonnullOwnPtrVectorAndreas Kling
Same as NonnullRefPtrVector: weird semantics, questionable benefits.
2023-01-27AK: Remove StringBuilder::build() in favor of to_deprecated_string()Linus Groh
Having an alias function that only wraps another one is silly, and keeping the more obvious name should flush out more uses of deprecated strings. No behavior change.
2023-01-02Everywhere: Remove unused includes of AK/Format.hBen Wiederhake
These instances were detected by searching for files that include AK/Format.h, but don't match the regex: \\b(CheckedFormatString|critical_dmesgln|dbgln|dbgln_if|dmesgln|FormatBu ilder|__FormatIfSupported|FormatIfSupported|FormatParser|FormatString|Fo rmattable|Formatter|__format_value|HasFormatter|max_format_arguments|out |outln|set_debug_enabled|StandardFormatter|TypeErasedFormatParams|TypeEr asedParameter|VariadicFormatParams|v_critical_dmesgln|vdbgln|vdmesgln|vf ormat|vout|warn|warnln|warnln_if)\\b (Without the linebreaks.) This regex is pessimistic, so there might be more files that don't actually use any formatting functions. Observe that this revealed that Userland/Libraries/LibC/signal.cpp is missing an include. In theory, one might use LibCPP to detect things like this automatically, but let's do this one step after another.
2023-01-02Everywhere: Move AK/Debug.h include to using files or removeBen Wiederhake
2022-12-31LibMarkdown: Indent blockquotes inside the terminal rendererArda Cinar
This removes one FIXME :^)
2022-12-31LibMarkdown: Render lines to terminal instead of a single stringArda Cinar
With this patch, the blocks in a markdown document render a vector of lines. These lines get concatenated in Document::render_to_terminal, so this does not change any external APIs of LibMarkdown. This change makes it possible to indent individual lines in the rendered markdown. So, rendering blockquotes in a similar way to code blocks :^)
2022-12-15LibMarkdown: Prevent a crash when rendering code blocks to consoleArda Cinar
When parsing a code block not in a section (in a file without a heading), the parser would initialize the code block with an uninitialized (invalid) value for current_section. Accessing this value would later cause a segmentation fault in render_to_terminal.
2022-12-15LibMarkdown: Handle error while rendering JS to HTMLArda Cinar
The library logs the error and falls back to not colorizing the js code inside the block instead.
2022-12-07LibJS: Convert MarkupGenerator to the new StringLinus Groh
2022-12-06Everywhere: Rename to_{string => deprecated_string}() where applicableLinus Groh
This will make it easier to support both string types at the same time while we convert code, and tracking down remaining uses. One big exception is Value::to_string() in LibJS, where the name is dictated by the ToString AO.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-11-03Everywhere: Clean up "the the" comment typosNico Weber
2022-11-01Everywhere: Mark dependencies of most targets as PRIVATETim Schumacher
Otherwise, we end up propagating those dependencies into targets that link against that library, which creates unnecessary link-time dependencies. Also included are changes to readd now missing dependencies to tools that actually need them.
2022-10-24AK+Everywhere: Turn bool keep_empty to an enum in split* functionsdemostanis
2022-09-28LibMarkdown: Allow extra content to be inserted into HTML output's headSam Atkins
This lets users supply custom styling and scripting, among other things.
2022-09-01LibMarkdown: Add newline and remove ANSI escape after code blocksdemostanis
Also make clang-tidy happy by making line a const&
2022-08-04LibMarkdown: Fix coloring of the first linedemostanis
The escape sequence to color a section's name was separated by a newline from the section's name, making less(1) trim the escape sequence off when the section's name was on the first line.
2022-08-04LibMarkdown: Indent code blocksdemostanis
2022-08-04LibMarkdown: Implement the image size extensionMacDue
This implements the image size extension that's quite commonly used: https://github.com/commonmark/commonmark-spec/wiki/Deployed-Extensions#image-size This supports specifying... Both width and height: ![](foo.png =100x200) Width only: ![](foo.png =100x) Height only: ![](foo.png =x200) The size is always in pixels (relative sizing does not seem to be spec'd anywhere).
2022-07-12Everywhere: Replace single-char StringView op. arguments with charssin-ack
This prevents us from needing a sv suffix, and potentially reduces the need to run generic code for a single character (as contains, starts_with, ends_with etc. for a char will be just a length and equality check). No functional changes.
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-04-28LibMarkdown: Add strike-through text support to markdownhuttongrabiel
Using ~~text~~ syntax will strike out the text between the two tildes. Only missing portion is the terminal rendering of strike through text. The ansi escape codes for strike through text are \e[9m and \e[29m but it appears the terminal does not support these. Please correct me if I am wrong. I tested that the render_to_terminal function was being called by giving it bold ANSI escape codes, and that did work so the function is being called correctly.
2022-04-26LibMarkdown: Correct typo in forward declaration of HorizontalRulehuttongrabiel
HoriziontalRule -> HorizontalRule
2022-04-26LibMarkdown: Treat whitespace-only lines as blank in paragraphsPeter Elliott
2022-04-26LibMarkdown: Don't put a newline in empty code blocksPeter Elliott
This doesn't actually matter, but I'm trying to match the commonmark test cases where possible.
2022-04-26LibMarkdown: Better support for code fencesPeter Elliott
- Support tildes. - Support different lengths of fence. - Begrudgingly keep support for serenities one markdown extension.
2022-04-26LibMarkdown: Support up to 3 spaces before an ATX headerPeter Elliott
2022-04-26LibMarkdown: Limit headings to 6 levelsPeter Elliott
2022-04-26LibMarkdown: Make thematic break parsing more correctPeter Elliott
also fix a conflict with lists and thematic breaks
2022-04-26LibMarkdown: Ignore backslash on non-punctuation charactersPeter Elliott
2022-04-26LibMarkdown: Add support for indented code blocksPeter Elliott
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-13Libraries: Use default constructors/destructors in LibMarkdownLenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2022-02-17LibMarkdown: Add terminal color formattingxSlendiX
This patch adds color formatting to markdown viewed in the terminal. This also increases readability.
2022-02-17LibMarkdown: Add additional spacing for terminal renderingxSlendiX
This patch adds spacing to give a sense of structure to markdown documents viewed in the terminal. This also makes the content easier to read.
2022-01-07Everywhere: Fix spelling mistakesmjz19910
2022-01-06LibMarkdown: Output alignment when rendering HTML tablesSam Atkins
Previously, only terminal output aligned table column contents correctly. Now, we apply a `text-align` to each cell. This does not actually *work* however, since LibWeb's table layout code is not yet fully functional.
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-11-03LibMarkdown: Allow nested linksAndreas Kling
This fixes an issue where the linked images in our README.md didn't get turned into images.
2021-11-01LibMarkdown: Recognize and handle commentsBen Wiederhake
This also improves Commonmark coverage, e.g. it fixes tests HTML_blocks_ex179_2894..2906 and Lists_ex308_5439..5457. In other words, we go from 271 out of 652 to 273 out of 652.
2021-10-10LibMarkdown: Implement introspection of the document treeBen Wiederhake
2021-10-10LibMarkdown: Make href always a StringBen Wiederhake
This already was the case in some sense, but made it very inconvenient to access it.
2021-10-09LibMarkdown: Have one newline between lists in terminal rendersDavid Isaksson
Before this patch the markdown lists would have two space inbetween each item. This patch removes one of these newlines for a nicer render.
2021-10-06LibMarkdown: Add blockquotesPeter Elliott
2021-10-06LibMarkdown: Add blockquote support to LineIteratorPeter Elliott
This patch adds contexts to line iterator for nesting list items and blockquotes. It also incidentally makes the api for LineIterator simpler, and will make it easier to add other containers in the future.
2021-10-05LibMarkdown: Add start numbers for ordered listsPeter Elliott
5. hey -> <ol start="5"><li>hey</li></ol>
2021-10-05LibMarkdown: Allow spaces before list itemsPeter Elliott
also allow '+' as an unordered list marker
2021-10-05LibMarkdown: Implement "tightness" for listsPeter Elliott
From the commonmark spec: A list is loose if any of its constituent list items are separated by blank lines, or if any of its constituent list items directly contain two block-level elements with a blank line between them. Otherwise a list is tight. (The difference in HTML output is that paragraphs in a loose list are wrapped in <p> tags, while paragraphs in a tight list are not.)
2021-10-05LibMarkdown: Allow non-text items in ListsPeter Elliott