-
Notifications
You must be signed in to change notification settings - Fork 808
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
Markdown Block: Add full support for markdown-it features #18035
Comments
Noting that some / most of those extra features are achieved via extra options and / or plugins, and thus would require extra dependencies. That's not to say we shouldn't implement them, though. |
Wrong. Even I could deduce WordPress for some reason has no highlight.js included. It is not just enough to use some other markdown block/plugin. I tried and still, there was no syntax coloring. So I did some very short googling and then I added it, and voila, I have the coloring now. https://dbj.org/cpp-zen-of-the-sad-path Just then, I discovered this blog and post: https://adrien.poupa.fr/highlight-js-on-wordpress and left two comments there. |
Would a PR be welcome, @jeherve ? |
@robsonsobral Yep, I'd be happy to review a PR about this, thank you! |
I'm trying, @jeherve , but having a hard time to make the dev environment to work:
I'm reading a lot online, without luck. |
@robsonsobral At what point do you run into this issue? When installing WordPress when the Docker instance is being set up? |
The container just stops after this error. It goes up, tries to check the new version of WP, fails and goes down. |
What happens when you try to load that URL in your browser? Can you access it? |
I've no idea what happened! I tried again and it worked! Maybe, my Docker installation is haunted! Thank you, @jeherve ! I'm sorry. |
Jesus, it's hard! └─> npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: Jetpack@10.9.0-a.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! optional react@"17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8" from @automattic/components@1.0.0-alpha.3
npm ERR! node_modules/@automattic/components
npm ERR! @automattic/components@"1.0.0-alpha.3" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution. Let's try harder: └─> npm install --force
npm WARN using --force Recommended protections disabled.
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "workspace:": workspace:* || ^0.1 Should I give up? |
We don't use To make all this easier to remember, we have a wrapper, You can also check this script to figure out if you have all the tools you need: |
All tools installed and checked. However, now, I can't install jetpack...
Jesus... |
Do you see the vendor directories in your Jetpack plugin installation? Did you build the plugin so those dependencies could be installed? You can do so using the CLI tool I mentioned above, for example. Let us know how that goes. |
Yeah, I've the directory I'm sorry, @jeherve . I didn't imagine it would take so long. I'm not a WP dev. |
Will solving this issue signify parity in terms of features supported between the classic and block implementations of Markdown in Jetpack? I've been struggling with trying to get the Markdown block to work for my use cases and find it alarming that, even when the issue is resolved then a lot of the Markdown I write will not work with the Markdown block as implemented because the block doesn't implement the same Markdown features than the PHP version does |
Good. Do you have
I'm sorry too! Since this GitHub repository can be used to build many different things (WordPress plugins, composer packages, JavaScript packages), the original development environment is more involved than if we were just working with a single thing.
Adding support for more markdown-it features (what we aim to do with this issue) would indeed bridge that gap, and fix a lot of the inconsistencies logged in #11881. That said, I can't guarantee that it will bring full parity, as ultimately the 2 features are implemented differently. We can continue work towards that parity though, even we're done adding markdown-it features to the block. If there are specific differences that you know about, and that are not listed in #11881, do not hesitate to comment there so we know about it. Thank you! |
@jeherve , I'm back! Here we go:
Let's remove PHP 8.1 and install 8.0. Now, I'm getting:
So, let's run
And... Running
The development checker reports: Jetpack development environment check
=====================================
Monorepo path: /mnt/e/_repositories/jetpack
Shell tools
===========
* Usable version of bash ... ok (version 5.0.17(1)-release)
* Standard tools are available ... yes
* If sed accepts -E ... yes
* Usable version of jq ... ok (version 1.6)
PHP tools
=========
* Usable version of PHP ... ok (version 8.0.19)
* Usable version of Composer ... ok (version 2.2.12)
* Required extensions are installed ... yes
JavaScript tools
================
* Usable version of Node.js ... ok (version 16.14.2)
* Usable version of pnpm ... ok (version 6.32.6)
* [optional] nvm is available ... no
See https://github.com/Automattic/jetpack/blob/master/docs/development-environment.md#nodejs
Tools for contributing
======================
* Usable version of git ... ok (version 2.35.2)
* If this is a git checkout ... yes
* If the repo is checked out using ssh ... yes
Installation
============
* Command jetpack is available ... yes
* If JS modules are installed ... yes
* If PHP modules are installed ... yes
Docker
======
* [optional] Docker is available ... yes
* [optional] Docker-compose is available ... yes (version unknown)
* [optional] Docker is running ... yes However, NVM is installed! I really need this feature for a client and I thought it would be a matter of install deps and write some tests, but... I can't even run the development environment... 😞 I tried on Windows, on Ubuntu... Should I light a candle? |
Ok! Nothing a How should I proceed, @jeherve ? $ jetpack build
? What type of project are you working on today? (Use arrow keys)
❯ github-actions
js-packages
packages
plugins (I'm afraid of breaking something again) |
Hi @robsonsobral ! The next step would be 'plugins', then 'jetpack' (I don't believe you should need to build dependencies which is the last prompt, but then again it shouldn't break anything if you do). You can also type in |
Sooooo, I'm back to this point. I log into wp-admin, go to plugins, but I can't activate Jetpack. I tried:
They activate just fine. No problem. However, I can't activate Jetpack Version 10.9-a.0:
I'm working on master branch, just after the commit 79e490c from 2022-03-30. Am I on the right place, @coder-karen ? Thank you so much for your attention and help. |
You should still be able to build the Jetpack plugin and access it from the master branch, though if you're going to make any file changes you'd need to create a new feature branch. That said it should still ideally be working there on master. Out of curiosity, do you get any errors when running If the correct version of node shows when running Something else to try - It may also be worth re-running the command to update Jetpack dependencies: |
So, what I did, Now,
Then, again Let's restart Docker and...
Dammed... Let's reset the Docker image! No luck! Back to not be able to activate Jetpack:
( I didn't know there's more info on the message. They are hidden beyond the scroll!) Thank you for your patience! |
Interestingly, it always seems to come back to issues with |
Test 1: $ composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 0 installs, 0 updates, 0 removals
Generating autoload files
2 packages you are using are looking for funding.
Use the `composer fund` command to find out more! No luck! Test 2: $ cd projects/plugins/jetpack && composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Generating autoload files
Generating jetpack autoloader (/mnt/e/_repositories/jetpack/projects/plugins/jetpack/vendor/jetpack-autoloader/)
Generated: ../autoload_packages.php
Generated: class-autoloader-handler.php
Generated: class-autoloader-locator.php
Generated: class-autoloader.php
Generated: class-container.php
Generated: class-hook-manager.php
Generated: class-latest-autoloader-guard.php
Generated: class-manifest-reader.php
Generated: class-path-processor.php
Generated: class-php-autoloader.php
Generated: class-plugin-locator.php
Generated: class-plugins-handler.php
Generated: class-shutdown-handler.php
Generated: class-version-loader.php
Generated: class-version-selector.php
Generating jetpack autoloader manifests (/mnt/e/_repositories/jetpack/projects/plugins/jetpack/vendor/composer)
Generated: jetpack_autoload_classmap.php
Generated: jetpack_autoload_psr4.php
Generated: jetpack_autoload_filemap.php
You are generating an unoptimized autoloader. If this is a production build, consider using the -o option.
36 packages you are using are looking for funding.
Use the `composer fund` command to find out more! No luck! Another suggestion, @jeherve ? (Thank you so much you all) |
Alright. Does the same fatal error remain now, or is it different? Do you see the composer dependencies when navigating to the plugin folder inside the Docker container?
|
It's always the same error, @jeherve.
The contents of
Being |
Ah, interesting. Just to be sure, are you using WSL version 2? |
Fixes #11849 Also see #18035 and #11881. This involves bringing in a new dependency to the Jetpack plugin: - https://github.com/markdown-it/markdown-it-footnote - MIT License
Support References This comment is automatically generated. Please do not edit it.
|
Primary issue: #11881
With reference to the markdown-it demo code:
https://markdown-it.github.io/
The following features are not supported in the Markdown block:
Additional context
3558150-zen
The text was updated successfully, but these errors were encountered: