Try filtering output lines

This commit is contained in:
exu 2023-07-12 20:01:56 +02:00
parent ab7d5e9134
commit 3c156eaede
3 changed files with 11 additions and 11 deletions

View File

@ -68,14 +68,14 @@ First, the USB device you want to check has to be selected
```sh
lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 0c45:652f Microdia Backlit Gaming Keyboard
Bus 003 Device 002: ID 046d:c084 Logitech, Inc. G203 Gaming Mouse
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0781:55a3 SanDisk Corp. SanDisk 3.2Gen1
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2972:0047 FiiO Electronics Technology FiiO BTR5
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
(out) Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
(out) Bus 003 Device 003: ID 0c45:652f Microdia Backlit Gaming Keyboard
(out) Bus 003 Device 002: ID 046d:c084 Logitech, Inc. G203 Gaming Mouse
(out) Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
(out) Bus 002 Device 002: ID 0781:55a3 SanDisk Corp. SanDisk 3.2Gen1
(out) Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
(out) Bus 001 Device 002: ID 2972:0047 FiiO Electronics Technology FiiO BTR5
(out) Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
```
[/shuser]
@ -86,7 +86,7 @@ Now, using the ID, the USB class used can be determined
```sh
lsusb -d 0781:55a3 -v | grep bcdUSB
bcdUSB 3.20
(out) bcdUSB 3.20
```
[/shuser]

View File

@ -10,7 +10,7 @@ class Prismjsshroot extends Shortcode
$this->shortcode->getRawHandlers()->add('shroot', function(ShortcodeInterface $sc) {
$content = preg_replace('/^```.*(\n)?$/m', '', $sc->getContent());
$content = trim($content);
return '<pre class="command-line language-sh" data-prompt="#" data-continuation-str="\" tabindex="0"><code class="language-sh">'.$content.'</code></pre>';
return '<pre class="command-line language-sh" data-prompt="#" data-continuation-str="\" data-filter-output="(out)" tabindex="0"><code class="language-sh">'.$content.'</code></pre>';
});
}
}

View File

@ -10,7 +10,7 @@ class Prismjsshuser extends Shortcode
$this->shortcode->getRawHandlers()->add('shuser', function(ShortcodeInterface $sc) {
$content = preg_replace('/^```.*(\n)?$/m', '', $sc->getContent());
$content = trim($content);
return '<pre class="command-line language-sh" data-prompt="$" data-continuation-str="\" tabindex="0"><code class="language-sh">'.$content.'</code></pre>';
return '<pre class="command-line language-sh" data-prompt="$" data-continuation-str="\" data-filter-output="(out)" tabindex="0"><code class="language-sh">'.$content.'</code></pre>';
});
}
}