yrby 0.8.0-x86_64-linux → 0.8.1-x86_64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/README.md +13 -6
- data/lib/y/3.4/yrby.so +0 -0
- data/lib/y/4.0/yrby.so +0 -0
- data/lib/y/lexxy.rb +2 -2
- data/lib/y/rendering.rb +24 -0
- data/lib/y/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e56bf8c465b172f682b54a867c5d76b3060e1ed4f0e259038b2f2f49581e07c6
|
|
4
|
+
data.tar.gz: d33592ef24cd998eb50103884ce947a348e0d1b282330f5fcea5afb11e8e70d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7fdf897230250937ff3306101b43305de4660ba8a033696bfce4a25c9bce03ad93eb5ee76198e9d65212892ed5fe8b5bfad237a110466dadc013d9157cac2c8c
|
|
7
|
+
data.tar.gz: 1e45a4fa7c6e9740583f25d1bda6feaa5101be377976eee8087e457729890400a86821b797df114020da461ca8533a0ab5584b42f8dc223d11b0adaf2e045eda
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,37 @@ to follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.8.1] - 2026-10-03
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `unknown_types` on `Y::Lexical` and `Y::ProseMirror`, and so on `Y::Lexxy`
|
|
14
|
+
and `Y::Tiptap`. It lists the node types in a document that neither the
|
|
15
|
+
built-in schema nor a rule handles, which are the ones `to_html` can't fully
|
|
16
|
+
render. Render a real document from your editor in a test and assert the list
|
|
17
|
+
is empty.
|
|
18
|
+
- The renderer crates export `escape_text` and `escape_attr` for callers that
|
|
19
|
+
build their own markup (`lexical-yjs-html` 0.1.4, `prosemirror-yjs-html`
|
|
20
|
+
0.1.5).
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- The demo app and the render-parity test run on Lexxy 1.0. `Y::Lexxy`
|
|
25
|
+
output matches Lexxy 1.0's own `value`, including image alt text edited
|
|
26
|
+
after the document syncs.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- The Lexical renderers keep the text of an unknown inline wrapper, such as a
|
|
31
|
+
mark with no rule. The text renders without the wrapper. Before, the whole
|
|
32
|
+
node rendered as nothing, so its text was missing from the HTML.
|
|
33
|
+
- `Y::Lexxy`'s list-item rule escapes the stored `__checked` and `__value`
|
|
34
|
+
attributes. Collaborators write those attributes, and a crafted value could
|
|
35
|
+
break out of the HTML attribute. Normal values (booleans and integers) render
|
|
36
|
+
the same as before.
|
|
37
|
+
- The crate READMEs' callback examples escape the values they insert, and both
|
|
38
|
+
READMEs describe how unknown node types render.
|
|
39
|
+
|
|
9
40
|
## [0.8.0] - 2026-10-01
|
|
10
41
|
|
|
11
42
|
This release ships alongside yrby-client 0.6.0, and the client entries below
|
data/README.md
CHANGED
|
@@ -338,12 +338,12 @@ every editor configures its own. `Y::Lexical` is the core Lexical base
|
|
|
338
338
|
(paragraphs, headings, quotes, code, lists, tables, links, and the full
|
|
339
339
|
text-format model), and other Lexical editors extend it with rules.
|
|
340
340
|
|
|
341
|
-
It handles every node in the
|
|
342
|
-
format and their combinations, links, the
|
|
343
|
-
blockquotes, code blocks, tabs and soft breaks,
|
|
344
|
-
header cells, image galleries, and ActionText
|
|
345
|
-
both render as `<action-text-attachment>`
|
|
346
|
-
re-render.
|
|
341
|
+
It handles every node in Lexxy 1.0, which has the same set as 0.9.x:
|
|
342
|
+
paragraphs, headings, every text format and their combinations, links, the
|
|
343
|
+
four list types with nesting, blockquotes, code blocks, tabs and soft breaks,
|
|
344
|
+
horizontal rules, tables with header cells, image galleries, and ActionText
|
|
345
|
+
attachments. Uploads and mentions both render as `<action-text-attachment>`
|
|
346
|
+
elements, which ActionText can re-render.
|
|
347
347
|
|
|
348
348
|
The Lexical support has the same two layers. `Y::Lexical` handles core Lexical
|
|
349
349
|
structure natively, and everything Lexxy adds is in `Y::Lexxy`'s rule set,
|
|
@@ -401,6 +401,13 @@ attribute names your templates and blocks will read, and `children` and `text`
|
|
|
401
401
|
tell you which `contains:` to pick. Child block types mean `:blocks`, and text
|
|
402
402
|
means `:inline`.
|
|
403
403
|
|
|
404
|
+
`unknown_types` lists the types whose `handled` is nil. `to_html` still
|
|
405
|
+
renders them as well as it can. An unknown container or inline wrapper renders
|
|
406
|
+
its children without its own markup, so its text stays. A node that keeps its
|
|
407
|
+
content only in its attributes renders nothing. Either way, the node's markup is
|
|
408
|
+
missing from the HTML, and nothing raises. When you add editor nodes, add a test
|
|
409
|
+
that renders a real document and asserts `unknown_types` is empty.
|
|
410
|
+
|
|
404
411
|
When a declarative rule can't express the markup, give the node a block:
|
|
405
412
|
|
|
406
413
|
```ruby
|
data/lib/y/3.4/yrby.so
CHANGED
|
Binary file
|
data/lib/y/4.0/yrby.so
CHANGED
|
Binary file
|
data/lib/y/lexxy.rb
CHANGED
|
@@ -42,8 +42,8 @@ module Y
|
|
|
42
42
|
def self.list_item(node)
|
|
43
43
|
out = +"<li"
|
|
44
44
|
checked = node.attrs["__checked"]
|
|
45
|
-
out << %( aria-checked="#{checked}") unless checked.nil?
|
|
46
|
-
out << %( value="#{node.attrs["__value"] || 1}")
|
|
45
|
+
out << %( aria-checked="#{RenderRules.escape_attr(checked)}") unless checked.nil?
|
|
46
|
+
out << %( value="#{RenderRules.escape_attr(node.attrs["__value"] || 1)}")
|
|
47
47
|
out << %( class="lexxy-nested-listitem") if node.child_types.include?("list")
|
|
48
48
|
"#{out}>#{node.content}</li>"
|
|
49
49
|
end
|
data/lib/y/rendering.rb
CHANGED
|
@@ -241,6 +241,18 @@ module Y
|
|
|
241
241
|
json = root.nil? ? @native.node_types : @native.node_types(root)
|
|
242
242
|
json && JSON.parse(json)
|
|
243
243
|
end
|
|
244
|
+
|
|
245
|
+
# The node types to_html can't fully render: types in the document that
|
|
246
|
+
# neither the built-in schema nor a registered rule handles. An unknown
|
|
247
|
+
# container or inline wrapper renders its children without its own
|
|
248
|
+
# markup, so its text stays. An unknown decorator renders nothing, so
|
|
249
|
+
# content kept only in its attributes is missing from the HTML. Returns
|
|
250
|
+
# [] when every type is handled, and when the root is missing or isn't
|
|
251
|
+
# Lexical-shaped, because to_html returns nil there.
|
|
252
|
+
def unknown_types(root = nil)
|
|
253
|
+
types = node_types(root)
|
|
254
|
+
types ? types.filter_map { |type, info| type if info["handled"].nil? } : []
|
|
255
|
+
end
|
|
244
256
|
end
|
|
245
257
|
|
|
246
258
|
class ProseMirror
|
|
@@ -276,6 +288,18 @@ module Y
|
|
|
276
288
|
json = root.nil? ? @native.node_types : @native.node_types(root)
|
|
277
289
|
json && JSON.parse(json)
|
|
278
290
|
end
|
|
291
|
+
|
|
292
|
+
# The node types to_html can't fully render: types in the document that
|
|
293
|
+
# neither the built-in schema nor a registered rule handles. An unknown
|
|
294
|
+
# node renders its text and children without its own markup. A node that
|
|
295
|
+
# keeps its content only in its attributes renders nothing. Marks aren't
|
|
296
|
+
# listed, and an unknown mark renders its text unformatted. Returns []
|
|
297
|
+
# when every type is handled, and when the root is missing or isn't
|
|
298
|
+
# ProseMirror-shaped, because to_html returns nil there.
|
|
299
|
+
def unknown_types(root = nil)
|
|
300
|
+
types = node_types(root)
|
|
301
|
+
types ? types.filter_map { |type, info| type if info["handled"].nil? } : []
|
|
302
|
+
end
|
|
279
303
|
end
|
|
280
304
|
|
|
281
305
|
private_constant :NativeLexical, :NativeProseMirror
|
data/lib/y/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yrby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.1
|
|
5
5
|
platform: x86_64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- JP Camara
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: minitest
|