ocsigen / ocsigen/tyxml

Add an option to txt to not touch whitespace in pre-formatted strings

Open
#285 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
OCaml
Stars
179
Forks
63
Avg merge
5h
Merged PRs (30d)
22

Description

Sometimes in tyxml apps one receives a pre-formatted string that is rendered with white-space: pre;.

At the moment, the only way to handle this case is by disabling indentation for whole tree altogether. It'd be nice to add an option to txt to honour new lines and other whitespace specifically for a single text element.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the implementation of txt and the existing option that disables indentation for the whole tree. Add a per-text-element option that preserves newlines and other whitespace for pre-formatted strings while keeping current behavior by default; verify both modes with the relevant existing tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
frontend, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.