* Use a tree‐based approach for adv. text formatting Sanitizing HTML/Markdown means parsing the content into an HTML tree under‐the‐hood anyway, and it is more accurate to do mention/hashtag replacement on the text nodes in that tree than it is to try to hack it in with regexes et cetera. This undoes the overrides of `#entities` and `#rewrite` on `AdvancedTextFormatter` but also stops using them, instead keeping track of the parsed Nokogiri tree itself and using that in the `#to_s` method. Internally, this tree uses `<mastodon-entity>` nodes to keep track of hashtags, links, and mentions. Sanitization is moved to the beginning, so it should be known that these do not appear in the input. * Also disallow entities inside of `<code>` I think this is generally expected behaviour, and people are annoyed when their code gets turned into links/hashtags/mentions. * Minor cleanup to AdvancedTextFormatter * Change AdvancedTextFormatter to rewrite entities in one pass and sanitize at the end Also, minor refactoring to better match how other formatters are organized. * Add some tests Co-authored-by: Claire <claire.github-309c@sitedethib.com> |
||
|---|---|---|
| .circleci | ||
| .devcontainer | ||
| .github | ||
| app | ||
| bin | ||
| chart | ||
| config | ||
| db | ||
| dist | ||
| lib | ||
| log | ||
| public | ||
| spec | ||
| streaming | ||
| vendor | ||
| .browserslistrc | ||
| .buildpacks | ||
| .codeclimate.yml | ||
| .deepsource.toml | ||
| .dockerignore | ||
| .editorconfig | ||
| .env.production.sample | ||
| .env.test | ||
| .env.vagrant | ||
| .eslintignore | ||
| .eslintrc.js | ||
| .foreman | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| .haml-lint.yml | ||
| .nanoignore | ||
| .nvmrc | ||
| .prettierignore | ||
| .prettierrc.js | ||
| .profile | ||
| .rspec | ||
| .rubocop.yml | ||
| .ruby-gemset | ||
| .ruby-version | ||
| .slugignore | ||
| .yarnclean | ||
| AUTHORS.md | ||
| Aptfile | ||
| CHANGELOG.md | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| Capfile | ||
| Dockerfile | ||
| FEDERATION.md | ||
| Gemfile | ||
| Gemfile.lock | ||
| LICENSE | ||
| Procfile | ||
| Procfile.dev | ||
| README.md | ||
| Rakefile | ||
| SECURITY.md | ||
| Vagrantfile | ||
| app.json | ||
| babel.config.js | ||
| config.ru | ||
| crowdin.yml | ||
| docker-compose.yml | ||
| ide-helper.js | ||
| jest.config.js | ||
| jsconfig.json | ||
| package.json | ||
| postcss.config.js | ||
| priv-config | ||
| scalingo.json | ||
| stylelint.config.js | ||
| yarn.lock | ||
README.md
Mastodon Glitch Edition
Now with automated deploys!
So here's the deal: we all work on this code, and anyone who uses that does so absolutely at their own risk. can you dig it?
- You can view documentation for this project at glitch-soc.github.io/docs/.
- And contributing guidelines are available here and here.