Conversation
doc_html/flat_text.rs: - extract_flat_text(): Paragraph.runs[] → (text, char_shapes[], text_len) - find_char_shape_at(): binary search로 위치별 char_shape_id 조회 - 테스트 3개 (simple text, tab, char_shape lookup) Run 트리 → flat 구조 변환으로 old viewer의 LineSegment 렌더러가 Document 모델과 호환되는 데이터를 받을 수 있게 함. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
doc_html/layout_text.rs:
- render_layout_text(): flat text + FlatCharShapeInfo[] → <span class="hrt cs{N}"> HTML
- convert_consecutive_spaces(): leading/연속/trailing 공백 → 변환
- apply_inline_styles(): italic/underline/strikethrough/super/sub 인라인 태그
- 탭 문자 → htC span 변환
- 테스트 2개 (공백 변환, 기본 렌더링)
old viewer의 text.rs와 동일한 출력을 Document 모델에서 생성.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
doc_html/layout_line_segment.rs: - render_line_segments(): LineSegmentInfo[] + flat text → hls div HTML 각 줄을 mm 절대 좌표로 배치 (top/left/height/width) - 빈 세그먼트 스킵 (flags.is_empty_segment) - CharShape 구간을 세그먼트 범위로 필터링/오프셋 조정 - 테스트 2개 (빈 입력, 단일 줄) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
doc_to_html 레이아웃 엔진 Phase 2: 핵심 텍스트 렌더링 + 라인 세그먼트 배치
flat_text.rs — Run[] → flat 구조 어댑터
extract_flat_text(): Paragraph.runs[] → (text, char_shapes[], text_len)find_char_shape_at(): binary search 위치별 조회layout_text.rs — CharShape-segmented 텍스트 렌더러
render_layout_text(): flat text →<span class="hrt cs{N}">HTMLconvert_consecutive_spaces(): 공백 → 변환apply_inline_styles(): italic/underline/strikethrough/super/sublayout_line_segment.rs — hls div 절대 좌표 배치
render_line_segments(): LineSegmentInfo[] + flat text → hls div HTMLTest plan
cargo test— 전체 workspace 0 FAILED🤖 Generated with Claude Code